One morning not long ago I installed a different graphics card and my machine no longer connected to the network upon startup.
The interface was not coming up and this being Arch Linux, it was netctl wouldn’t start, but it was being catty about why.
Having written about systemd before, I thought this might be a piece of cake to figure out, so I rolled up my sleeves.
I know that after a bunch of checks it just calls
/usr/lib/network start eth, so I called it and found that my onboard network card had been renamed enp3s0 instead of enp2s0, so I changed the reference in
/usr/lib/network start eth would get me online, but the machine would still not bring the interface up on boot! Netctl still wasn’t satisfied:
[root@wir ~]# systemctl status netctl ● netctl.service - (Re)store the netctl profile state Loaded: loaded (/usr/lib/systemd/system/netctl.service; enabled; vendor preset: disabled) Active: active (exited) since Sat 2015-10-10 12:53:55 CEST; 6min ago Process: 1027 ExecStart=/usr/bin/netctl restore (code=exited, status=1/FAILURE) Main PID: 1027 (code=exited, status=1/FAILURE) CGroup: /system.slice/netctl.service Oct 10 12:53:55 wir systemd: Starting (Re)store the netctl profile state... Oct 10 12:53:55 wir systemd: Started (Re)store the netctl profile state.
Lets try netctl directly:
# netctl start eth # "failed, refer to journald -xn"
Oct 10 12:56:37 wir systemd: sys-subsystem-net-devices-enp2s0.device: Job sys-subsystem-net-devices-enp2s0.device/start timed out. Oct 10 12:56:37 wir systemd: Timed out waiting for device sys-subsystem-net-devices-enp2s0.device. -- Subject: Unit sys-subsystem-net-devices-enp2s0.device has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit sys-subsystem-net-devices-enp2s0.device has failed. -- -- The result is timeout. Oct 10 12:56:37 wir systemd: Dependency failed for A basic dhcp ethernet connection. -- Subject: Unit email@example.com has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit firstname.lastname@example.org has failed. -- -- The result is dependency. Oct 10 12:56:37 wir systemd: email@example.com: Job firstname.lastname@example.org/start failed with result 'dependency'. Oct 10 12:56:37 wir polkitd: Unregistered Authentication Agent for unix-process:2441:16689 (system bus name :1.13, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (discon Oct 10 12:56:37 wir systemd: sys-subsystem-net-devices-enp2s0.device: Job sys-subsystem-net-devices-enp2s0.device/start failed with result 'timeout'.
Now I had no idea where to find
sys-subsystem-net-devices-enp2s0.device, and started poking around in
/etc/systemd/system. Finally I found
/email@example.com which seems to be the failing service, and sure enough, it refers to the device, so I changed it:
[Unit] Description=A basic dhcp ethernet connection BindsTo=sys-subsystem-net-devices-enp3s0.device After=sys-subsystem-net-devices-enp3s0.device
After that netctl would boot again.
I just wanted to say that this problem is lame. I was under the impression that the (already lame) predictable network card renaming from eth0 to enpXsY was supposed to be stable to avoid this problem.
Furthermore, systemd and netctl made a very long line of breadcrums to finally solve this, instead of being obvious.
Note that the firstname.lastname@example.org file was created by netctl and not me, so I had no prior knowledge of its existence.
And yes, clearly I should have just called `netctl reenable eth`
but that begs the question how should I have known about this without consulting the arch wiki?
Another thing I could have done to save me troubles was to disasble predictable network card renaming entirely, by booting the kernel with `net.ifnames=0`.
But then I would not be learning.