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 Jelle van der Waa (jelly) - Friday, 11 August 2023, 15:48 GMT
Opened by Nathaniel Harward (nharward) - Thursday, 01 August 2013, 01:21 GMT
Last edited by Jelle van der Waa (jelly) - Friday, 11 August 2023, 15:48 GMT
|
Details
Description:
As part of setting up a QEMU instance I created the following profile in /etc/netctl/bridge: Description="Bridge connection" Interface=br0 Connection=bridge BindsToInterfaces=(eth0) IP=dhcp 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
Closed by Jelle van der Waa (jelly)
Friday, 11 August 2023, 15:48 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/n etctl/issues/4
Friday, 11 August 2023, 15:48 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/n etctl/issues/4
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.
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?