FS#35224 - [netctl] Problem with netctl-ifplugd@.service and udev/systemd network device naming
Attached to Project:
Arch Linux
Opened by Wilhelm Schuster (wlhlm) - Sunday, 12 May 2013, 18:41 GMT
Last edited by Jouke Witteveen (jouke) - Saturday, 01 June 2013, 14:10 GMT
Opened by Wilhelm Schuster (wlhlm) - Sunday, 12 May 2013, 18:41 GMT
Last edited by Jouke Witteveen (jouke) - Saturday, 01 June 2013, 14:10 GMT
|
Details
Description:
There is a problem with the netctl systemd-unit `netcl-ifplugd@.service` in conjunction with udev. Originally, my network device is named `enp0s7` and systemd creates a unit file `sys-subsystem-net-devices-enp0s7.device` for it. Udev changes the name to `eth1` later on. So, in the end the network adapter is known as eth1 to the system, but the systemd-device file doesn't change. To monitor whether a cable is plugged into my network adapter, I have to start ifplugd at `eth1`, but in `netctl-ifplugd@.service` under `[Unit]` there are also these lines: BindsTo=sys-subsystem-net-devices-%i.device After=sys-subsystem-net-devices-%i.device The problem here is, that there is no device file for `eth1`, only for `enp0s7`. Trying to start the netctl-ifplugd@eth1.service gives an error, since I start ifplugd at eth1 which is the correct name, but the is no systemd-device for it. `journalctl -xn`-output is in the attached file "jorunalctl.txt". The udev-rule, that changes the network device name looks like this: $ cat /etc/udev/rules.d/network_persistent.rules SUBSYSTEM=="net", ATTR{address}=="...", NAME="eth0" SUBSYSTEM=="net", ATTR{address}=="...", NAME="eth1" (The file has been created automatically) $ ip link 1: lo: ... 2: eth1: ... 3. eth0: ... $ systemctl list-units --type=device ... sys-subsystem-net-devices-enp0s7.device loaded active plugged MCP61 Ethernet sys-subsystem-net-devices-enp1s8.device loaded active plugged RTL-8139/8139C/8139C+ ... Additional info: I switched from netcfg to netctl. - package version(s): * netctl-1.0-1 * systemd-203-2 |
This task depends upon
Closed by Jouke Witteveen (jouke)
Saturday, 01 June 2013, 14:10 GMT
Reason for closing: Works for me
Additional comments about closing: At least it works in the case of persistent naming.
Saturday, 01 June 2013, 14:10 GMT
Reason for closing: Works for me
Additional comments about closing: At least it works in the case of persistent naming.
http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
I guess, on newer arch installations, network devices will get these new names and everything should work as expected.
Simply deleting the file `/etc/udev/rules.d/network_persistent.rules` fixed it for me (be sure to check whether there are any daemons, that explicitly bind to a specific device name).
These unit files are named like `sys-subsystem-net-devices-NETWORK_ADAPTER.device`, in which "NETWORK_ADAPTER" is a persistent device name, so for example I had the file `sys-subsysten-net-devices-enp0s7.device`.
I also had a udev rule in `/etc/udev/rules.d/network_persistent` which looked like that:
SUBSYSTEM=="net", ATTR{address}=="<mac_address>", NAME="eth0"
I guess, on start-up systemd gives the network adapter a persistent name (like `enp0s7`) and after that the udev rule kicks in and renames this adapter to `eth0`.
In that configuration I had a network device known to the system as `eth0`, but systemd created a device file for this adapter, naming it `enp0s7`. This conflicts with netctl-ifplugd@.service, which assumes that the system name of the adapter and the name of the device file are the same.
I'm not shure, but I think the udev rule in `/etc/udev/rules.d/network_persistent` has been created by the archboot installer, which I used to setup my system.