FS#43554 - [netctl] netctl-ifplugd can't start wired network with static address

Attached to Project: Arch Linux
Opened by Nicola Mori (snack) - Saturday, 24 January 2015, 13:24 GMT
Last edited by Doug Newgard (Scimmia) - Wednesday, 28 October 2015, 13:58 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Jouke Witteveen (jouke)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
netctl-ifplugd in netctl 1.10-1 fails to start the wired network profile:

$ sudo systemctl status netctl-ifplugd@eth0.service
netctl-ifplugd@eth0.service - Automatic wired network connection using netctl profiles
Loaded: loaded (/usr/lib/systemd/system/netctl-ifplugd@.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2015-01-24 14:16:20 CET; 2s ago
Docs: man:netctl.special(7)
Main PID: 1002 (ifplugd)
CGroup: /system.slice/system-netctl\x2difplugd.slice/netctl-ifplugd@eth0.service
└─1002 /usr/bin/ifplugd -i eth0 -r /etc/ifplugd/netctl.action -bfIns

Jan 24 14:16:20 conan systemd[1]: Started Automatic wired network connection using netctl profiles.
Jan 24 14:16:20 conan ifplugd[1002]: ifplugd 0.28 initializing.
Jan 24 14:16:20 conan ifplugd[1002]: Using interface eth0/00:1A:92:24:9A:F4 with driver <forcedeth> (version: 0.64)
Jan 24 14:16:20 conan ifplugd[1002]: Using detection mode: SIOCETHTOOL
Jan 24 14:16:20 conan ifplugd[1002]: Initialization complete, link beat detected.
Jan 24 14:16:20 conan ifplugd[1002]: Executing '/etc/ifplugd/netctl.action eth0 up'.
Jan 24 14:16:20 conan ifplugd[1002]: client: <3>Could not start any suitable profile
Jan 24 14:16:20 conan ifplugd[1002]: Program execution failed, return value is 1.

Downgrading to netctl 1.9-1 solves the problem:

$ sudo systemctl status netctl-ifplugd@eth0.service
netctl-ifplugd@eth0.service - Automatic wired network connection using netctl profiles
Loaded: loaded (/usr/lib/systemd/system/netctl-ifplugd@.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2015-01-24 14:17:06 CET; 4s ago
Docs: man:netctl.special(7)
Main PID: 1058 (ifplugd)
CGroup: /system.slice/system-netctl\x2difplugd.slice/netctl-ifplugd@eth0.service
└─1058 /usr/bin/ifplugd -i eth0 -r /etc/ifplugd/netctl.action -bfIns

Jan 24 14:17:06 conan systemd[1]: Started Automatic wired network connection using netctl profiles.
Jan 24 14:17:06 conan ifplugd[1058]: Using interface eth0/00:1A:92:24:9A:F4 with driver <forcedeth> (version: 0.64)
Jan 24 14:17:06 conan ifplugd[1058]: Using detection mode: SIOCETHTOOL
Jan 24 14:17:06 conan ifplugd[1058]: Initialization complete, link beat detected.
Jan 24 14:17:06 conan ifplugd[1058]: Executing '/etc/ifplugd/netctl.action eth0 up'.
Jan 24 14:17:06 conan ifplugd[1058]: client: up
Jan 24 14:17:06 conan ifplugd[1058]: client: Reading profile 'ethernet'
Jan 24 14:17:06 conan ifplugd[1058]: client: Starting network profile 'ethernet'...
Jan 24 14:17:06 conan ifplugd[1058]: client: Started network profile 'ethernet'
Jan 24 14:17:06 conan ifplugd[1058]: Program executed successfully.

In both cases the network profile is this one:

Description='Static ethernet connection'
Interface=eth0
Connection=ethernet
IP=static
Address=('192.168.0.2/24')
Gateway='192.168.0.1'
DNS=('208.67.222.222' '208.67.220.220')

I have no other profile in /etc/netctl/:

$ ll /etc/netctl/
total 16
-rw-r--r-- 1 root root 430 Aug 12 18:22 ethernet
drwxr-xr-x 2 root root 4096 Jan 24 14:16 examples
drwxr-xr-x 2 root root 4096 Aug 5 14:58 hooks
drwxr-xr-x 2 root root 4096 Aug 5 14:58 interfaces

so I don't think that netctl 1.10-1 is trying to use a wrong profile.

Additional info:
* package version(s)
netctl 1.10-1

This task depends upon

Closed by  Doug Newgard (Scimmia)
Wednesday, 28 October 2015, 13:58 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Configuration issue
Comment by Jouke Witteveen (jouke) - Sunday, 25 January 2015, 09:05 GMT
I am sorry for the inconvenience. The usage of netctl-ifplugd was never properly documented and that changed in version 1.10, see netctl.profile(5).

To enable a profile that uses a static IP address for automatic profile selection, you need to add
ExcludeAuto=no
to the profile. The order in which profiles are tried can be influenced by the Priority= variable. Profiles with the same priority value are tried in alphabetical ordering.

The following is taken from https://bbs.archlinux.org/viewtopic.php?id=192607.
Let me give an explanation. In automatic profile selection, it is the role of netctl to decide not only when to start a profile, but also which profile to start.
For wireless connections netctl looks at the ESSID and signal strength to select a profile. For wired profiles, the best it can do is try profiles that could fail. A dhcp client will time out if no dhcp server is active, hence profiles that use dhcp can fail. The same does not hold for profiles that use static addresses. How could netctl determine which profile to start? It cannot and therefore such profiles are excluded from automatic profile selection by default.
In some cases this is not what you want. One such case is present in this topic, where there is only one static profile for an interface and it makes sense to use it. Another such case is when suitability of a profile can be tested, for example by testing reachability of some server. By adding ExecUpPost="/usr/bin/arping -qf -w 1 -I $Interface 192.168.2.1" to a profile that uses a static address, the profile can fail and is suitable for automatic profile selection. In this case too, it is meaningful to add ExcludeAuto=no to the profile.

Comment by Nicola Mori (snack) - Sunday, 25 January 2015, 10:33 GMT
Thanks Jouke, adding ExcludeAuto=no to the profile fixes the problem.

Loading...