Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#36353 - [netctl] netctl-ifplugd@.service does not properly handle interfaces that are part of a bridge

Attached to Project: Arch Linux
Opened by Nathaniel Harward (nharward) - Thursday, 01 August 2013, 01:21 GMT
Last edited by Jouke Witteveen (jouke) - Tuesday, 06 May 2014, 10:25 GMT
Task Type Bug Report
Category Arch Projects
Status Assigned
Assigned To Jouke Witteveen (jouke)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 2
Private No



As part of setting up a QEMU instance I created the following profile in /etc/netctl/bridge:

Description="Bridge connection"

Enabling the netctl-ifplugd@eth0.service fails as /etc/ifplugd/netctl.action only pays attention to ethernet connections.
The following patch against the current Git repo (HEAD is currently at daf1950 as of time of writing) seems to resolve the problem (sorry if my shell scripting is ugly):

diff --git a/src/ifplugd.action b/src/ifplugd.action
index c87ac0c..6d87c6c 100755
--- a/src/ifplugd.action
+++ b/src/ifplugd.action
@@ -20,7 +20,7 @@ case "$2" in
echo "Reading profile '$profile'"
source "$PROFILE_DIR/$profile"
- [[ "$Interface" == "$1" && "$Connection" == "ethernet" ]] || continue
+ [[ "$Interface" == "$1" && "$Connection" == "ethernet" ]] || [[ "$Connection" == "bridge" && "$1" == "$(for iface in "${BindsToInterfaces[@]}"; do test "${iface}" == "$1" && echo "${iface}" && break; done)" ]] || continue
is_yes "${AutoWired:-no}" && exit 1 # user preferred AUTO profile
[[ "$IP" == "dhcp" ]] && exit 2 # dhcp profile
exit 3 # static profile

With this patch I can plug/unplug my eth0 cable and ifplugd correctly starts and stops the "bridge" profile.

Additional info:
* package version(s) - 1.2-1

Steps to reproduce:

1. Create a bridge profile as in my example above, matching to the actual bridge and physical interfaces on the system
2. Disable all netctl profiles
3. As root run "systemctl start netctl-ifplugd@eth0.service" (replace eth0 with actual physical interface if not eth0)
4. Running "journalctl -f" or "systemctl status netctl-ifplugd@eth0.service" should show that it failed

Steps to fix:

1. Apply patch above to /etc/ifplugd/netctl.action
2. Re-run step 3 above
3. Job status should have succeeded and the bridge should be up
This task depends upon

Comment by Nathaniel Harward (nharward) - Saturday, 03 August 2013, 17:41 GMT
One note I forgot to add - the only machine I have access to has a single ethernet card.
As such I'm unable to test this patch against a *real* bridge.
It may be that when the 2nd+ interface in the bridge comes up through ifplugd that it will start the bridge profile when it's already running but again I can't verify myself.
Comment by Jouke Witteveen (jouke) - Sunday, 11 August 2013, 22:13 GMT
Is ifplugd supposed to work on bridges? The plug/unplug events occur on the slave interfaces; are they visible on the bridge too?
Comment by Nathaniel Harward (nharward) - Sunday, 11 August 2013, 23:40 GMT
Ifplugd only works on physical interfaces as far as I can tell.
I guess it's more a philosophical question whether this should be "fixed": should netctl worry about managing a bridge if the underlying physical device(s) are plugged/unplugged?