2

[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 [email protected] kicks in.

I first tried the Archlinux forum suggestion:

$ sudo cat /etc/udev/rules.d/10-network.rules
SUBSYSTEM=="net",ACTION=="add", ATTR{address}=="_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 ?

1 Answer 1

2

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.

2
  • wiki.archlinux.org/index.php/mkinitcpio Commented Nov 5, 2017 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
    Commented Nov 6, 2017 at 21:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .