Renaming USB-LAN dongle iface for gui logon with gdm on Xorg

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












[4.13.9-1-ARCH with gdm on Xorg]



I saw quite a few posts (e.g. here) related to starting a service at boot or recognizing a usb drive. But here I want to rename the default Ethernet (wired) iface of my USB LAN dongle to net0 at boot time, or at least BEFORE systemd service netctl-ifplugd@net0.service kicks in.



I first tried the Archlinux forum suggestion:



$ sudo cat /etc/udev/rules.d/10-network.rules
SUBSYSTEM=="net",ACTION=="add", ATTRaddress=="_mac_address_here_", NAME="net0"


EDIT:
The udev rule is executed when I log on to console. No prbm there.



If I wait say 1 minute before I log in via the gdm login menu, the iface is also correctly renamed



However if I log on via my gdm logon menu immediately after it appears on screen (that takes me about 3 to 5 seconds), then the interface is not renamed by the udevrule. When that happens, if I unplug and re-plug the USB LAN dongle, then the LAN interface gets renamed correctly.



However I want to avoid having to unplug and re-plug things every time I boot. Should be automatic.



Initially I thought that there was a pbm with my udev rule, then with a race condition between udev and network services kicking in. I now think this might be related to gdm on Xorg.



Any clue anybody ?







share|improve this question


























    up vote
    3
    down vote

    favorite












    [4.13.9-1-ARCH with gdm on Xorg]



    I saw quite a few posts (e.g. here) related to starting a service at boot or recognizing a usb drive. But here I want to rename the default Ethernet (wired) iface of my USB LAN dongle to net0 at boot time, or at least BEFORE systemd service netctl-ifplugd@net0.service kicks in.



    I first tried the Archlinux forum suggestion:



    $ sudo cat /etc/udev/rules.d/10-network.rules
    SUBSYSTEM=="net",ACTION=="add", ATTRaddress=="_mac_address_here_", NAME="net0"


    EDIT:
    The udev rule is executed when I log on to console. No prbm there.



    If I wait say 1 minute before I log in via the gdm login menu, the iface is also correctly renamed



    However if I log on via my gdm logon menu immediately after it appears on screen (that takes me about 3 to 5 seconds), then the interface is not renamed by the udevrule. When that happens, if I unplug and re-plug the USB LAN dongle, then the LAN interface gets renamed correctly.



    However I want to avoid having to unplug and re-plug things every time I boot. Should be automatic.



    Initially I thought that there was a pbm with my udev rule, then with a race condition between udev and network services kicking in. I now think this might be related to gdm on Xorg.



    Any clue anybody ?







    share|improve this question
























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      [4.13.9-1-ARCH with gdm on Xorg]



      I saw quite a few posts (e.g. here) related to starting a service at boot or recognizing a usb drive. But here I want to rename the default Ethernet (wired) iface of my USB LAN dongle to net0 at boot time, or at least BEFORE systemd service netctl-ifplugd@net0.service kicks in.



      I first tried the Archlinux forum suggestion:



      $ sudo cat /etc/udev/rules.d/10-network.rules
      SUBSYSTEM=="net",ACTION=="add", ATTRaddress=="_mac_address_here_", NAME="net0"


      EDIT:
      The udev rule is executed when I log on to console. No prbm there.



      If I wait say 1 minute before I log in via the gdm login menu, the iface is also correctly renamed



      However if I log on via my gdm logon menu immediately after it appears on screen (that takes me about 3 to 5 seconds), then the interface is not renamed by the udevrule. When that happens, if I unplug and re-plug the USB LAN dongle, then the LAN interface gets renamed correctly.



      However I want to avoid having to unplug and re-plug things every time I boot. Should be automatic.



      Initially I thought that there was a pbm with my udev rule, then with a race condition between udev and network services kicking in. I now think this might be related to gdm on Xorg.



      Any clue anybody ?







      share|improve this question














      [4.13.9-1-ARCH with gdm on Xorg]



      I saw quite a few posts (e.g. here) related to starting a service at boot or recognizing a usb drive. But here I want to rename the default Ethernet (wired) iface of my USB LAN dongle to net0 at boot time, or at least BEFORE systemd service netctl-ifplugd@net0.service kicks in.



      I first tried the Archlinux forum suggestion:



      $ sudo cat /etc/udev/rules.d/10-network.rules
      SUBSYSTEM=="net",ACTION=="add", ATTRaddress=="_mac_address_here_", NAME="net0"


      EDIT:
      The udev rule is executed when I log on to console. No prbm there.



      If I wait say 1 minute before I log in via the gdm login menu, the iface is also correctly renamed



      However if I log on via my gdm logon menu immediately after it appears on screen (that takes me about 3 to 5 seconds), then the interface is not renamed by the udevrule. When that happens, if I unplug and re-plug the USB LAN dongle, then the LAN interface gets renamed correctly.



      However I want to avoid having to unplug and re-plug things every time I boot. Should be automatic.



      Initially I thought that there was a pbm with my udev rule, then with a race condition between udev and network services kicking in. I now think this might be related to gdm on Xorg.



      Any clue anybody ?









      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 6 '17 at 22:21

























      asked Nov 4 '17 at 13:44









      Cbhihe

      2841315




      2841315




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote













          Your problem is totally elsewhere. udev started in very early boot stage from the initrd image. initrd doesn't contains your manually created rules in /etc. Check it with lsinitramfs /boot/initrd*.
          You can add your rules file to initramfs, but the much more proper way is do as your distro suggests. For example in Debian there is a /etc/initramfs-tools/ folder, where you have to put your custom files which will be in newly created initrds.






          share|improve this answer




















          • wiki.archlinux.org/index.php/mkinitcpio
            – Ipor Sircer
            Nov 5 '17 at 10:33










          • No, that's off. Booting to console makes the problem disappear... everything else being the same. Booting to gdm on Xorg or rather immediately starting a login session in gdm after the gdm login screen appears seems to makes the renaming rule croak. On the other hand, if I wait say 1 or 2 minutes before I login via the gdm login screen, the udev rule kicks in and all works well (wired interface on dongle renamed + priority connectivity to the dongle). So all this is related to gdm, not to the init runtime.
            – Cbhihe
            Nov 6 '17 at 21:42










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f402499%2frenaming-usb-lan-dongle-iface-for-gui-logon-with-gdm-on-xorg%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote













          Your problem is totally elsewhere. udev started in very early boot stage from the initrd image. initrd doesn't contains your manually created rules in /etc. Check it with lsinitramfs /boot/initrd*.
          You can add your rules file to initramfs, but the much more proper way is do as your distro suggests. For example in Debian there is a /etc/initramfs-tools/ folder, where you have to put your custom files which will be in newly created initrds.






          share|improve this answer




















          • wiki.archlinux.org/index.php/mkinitcpio
            – Ipor Sircer
            Nov 5 '17 at 10:33










          • No, that's off. Booting to console makes the problem disappear... everything else being the same. Booting to gdm on Xorg or rather immediately starting a login session in gdm after the gdm login screen appears seems to makes the renaming rule croak. On the other hand, if I wait say 1 or 2 minutes before I login via the gdm login screen, the udev rule kicks in and all works well (wired interface on dongle renamed + priority connectivity to the dongle). So all this is related to gdm, not to the init runtime.
            – Cbhihe
            Nov 6 '17 at 21:42














          up vote
          2
          down vote













          Your problem is totally elsewhere. udev started in very early boot stage from the initrd image. initrd doesn't contains your manually created rules in /etc. Check it with lsinitramfs /boot/initrd*.
          You can add your rules file to initramfs, but the much more proper way is do as your distro suggests. For example in Debian there is a /etc/initramfs-tools/ folder, where you have to put your custom files which will be in newly created initrds.






          share|improve this answer




















          • wiki.archlinux.org/index.php/mkinitcpio
            – Ipor Sircer
            Nov 5 '17 at 10:33










          • No, that's off. Booting to console makes the problem disappear... everything else being the same. Booting to gdm on Xorg or rather immediately starting a login session in gdm after the gdm login screen appears seems to makes the renaming rule croak. On the other hand, if I wait say 1 or 2 minutes before I login via the gdm login screen, the udev rule kicks in and all works well (wired interface on dongle renamed + priority connectivity to the dongle). So all this is related to gdm, not to the init runtime.
            – Cbhihe
            Nov 6 '17 at 21:42












          up vote
          2
          down vote










          up vote
          2
          down vote









          Your problem is totally elsewhere. udev started in very early boot stage from the initrd image. initrd doesn't contains your manually created rules in /etc. Check it with lsinitramfs /boot/initrd*.
          You can add your rules file to initramfs, but the much more proper way is do as your distro suggests. For example in Debian there is a /etc/initramfs-tools/ folder, where you have to put your custom files which will be in newly created initrds.






          share|improve this answer












          Your problem is totally elsewhere. udev started in very early boot stage from the initrd image. initrd doesn't contains your manually created rules in /etc. Check it with lsinitramfs /boot/initrd*.
          You can add your rules file to initramfs, but the much more proper way is do as your distro suggests. For example in Debian there is a /etc/initramfs-tools/ folder, where you have to put your custom files which will be in newly created initrds.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 4 '17 at 19:30









          Ipor Sircer

          8,8921920




          8,8921920











          • wiki.archlinux.org/index.php/mkinitcpio
            – Ipor Sircer
            Nov 5 '17 at 10:33










          • No, that's off. Booting to console makes the problem disappear... everything else being the same. Booting to gdm on Xorg or rather immediately starting a login session in gdm after the gdm login screen appears seems to makes the renaming rule croak. On the other hand, if I wait say 1 or 2 minutes before I login via the gdm login screen, the udev rule kicks in and all works well (wired interface on dongle renamed + priority connectivity to the dongle). So all this is related to gdm, not to the init runtime.
            – Cbhihe
            Nov 6 '17 at 21:42
















          • wiki.archlinux.org/index.php/mkinitcpio
            – Ipor Sircer
            Nov 5 '17 at 10:33










          • No, that's off. Booting to console makes the problem disappear... everything else being the same. Booting to gdm on Xorg or rather immediately starting a login session in gdm after the gdm login screen appears seems to makes the renaming rule croak. On the other hand, if I wait say 1 or 2 minutes before I login via the gdm login screen, the udev rule kicks in and all works well (wired interface on dongle renamed + priority connectivity to the dongle). So all this is related to gdm, not to the init runtime.
            – Cbhihe
            Nov 6 '17 at 21:42















          wiki.archlinux.org/index.php/mkinitcpio
          – Ipor Sircer
          Nov 5 '17 at 10:33




          wiki.archlinux.org/index.php/mkinitcpio
          – Ipor Sircer
          Nov 5 '17 at 10:33












          No, that's off. Booting to console makes the problem disappear... everything else being the same. Booting to gdm on Xorg or rather immediately starting a login session in gdm after the gdm login screen appears seems to makes the renaming rule croak. On the other hand, if I wait say 1 or 2 minutes before I login via the gdm login screen, the udev rule kicks in and all works well (wired interface on dongle renamed + priority connectivity to the dongle). So all this is related to gdm, not to the init runtime.
          – Cbhihe
          Nov 6 '17 at 21:42




          No, that's off. Booting to console makes the problem disappear... everything else being the same. Booting to gdm on Xorg or rather immediately starting a login session in gdm after the gdm login screen appears seems to makes the renaming rule croak. On the other hand, if I wait say 1 or 2 minutes before I login via the gdm login screen, the udev rule kicks in and all works well (wired interface on dongle renamed + priority connectivity to the dongle). So all this is related to gdm, not to the init runtime.
          – Cbhihe
          Nov 6 '17 at 21:42

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f402499%2frenaming-usb-lan-dongle-iface-for-gui-logon-with-gdm-on-xorg%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay