#1050297 ifupdown: allow-hotplug broken with sysvinit?

Package:
ifupdown
Source:
ifupdown
Description:
high level tools to configure network interfaces
Submitter:
Markus Demleitner
Date:
2024-04-08 10:32:00 UTC
Severity:
normal
#1050297#5
Date:
2023-08-22 18:37:01 UTC
From:
To:
Dear Maintainer,

I have an interfaces stanza like

  allow-hotplug wwan1
  iface wwan1 inet dhcp

– but the interface does not come up when the respective device is
plugged in.  In bullseye (the first release I ran that device with),
I hacked around it with a brief custom udev rule, but my
RUN+="/sbin/ifup wwan1" no longer works.  Digging around a bit,
I found the following in udev(7):

  Note that running programs that access the network or mount/unmount
  filesystems is not allowed inside of udev rules, due to the default
  sandbox that is enforced on systemd-udevd.service.

Rather than save my hack, I decided I should better figure out
how allow-hotplug actually ought to work.  It turns out that
/lib/udev/ifupdown-hotplug in the end only executes ifup, too, and
again in the context of udev.

Sprinkling logger calls into that script shows that all is fine until
the ifup call.  A statement on the next line is never executed,
presumably because udev's "sandbox" kills the parent process(es) of
offenders, too.

So... it would seem to me that at least on sysvinit boxes,
allow-hotplug cannot really work any more.  Am I missing
something?  If not: is there a workaround?
--- up and down scripts installed:
/etc/network/if-down.d:
total 24
-rwxr-xr-x 1 root root 281 Mar  4 13:27 _psi_warmal
-rwxr-xr-x 1 root root  62 Mar 25  2015 ifstats
lrwxrwxrwx 1 root root  17 Mar 12 09:01 jabber -> ../scripts/jabber
-rwxr-xr-x 1 root root 113 Jul 29  2021 monitor
-rwxr-xr-x 1 root root 372 Feb 24  2021 openvpn
-rwxr-xr-x 1 root root 323 Jan  5  2022 resolvconf
-rwxr-xr-x 1 root root 759 Dec  9  2022 resolved
lrwxrwxrwx 1 root root  32 Feb 24 14:01 wpasupplicant -> ../../wpa_supplicant/ifupdown.sh

/etc/network/if-post-down.d:
total 8
-rwxr-xr-x 1 root root   61 Oct 23  2018 block-wifi
lrwxrwxrwx 1 root root   25 Feb 24 14:01 hostapd -> ../../hostapd/ifupdown.sh
-rwxr-xr-x 1 root root 1409 Mar 24  2016 wireless-tools
lrwxrwxrwx 1 root root   32 Feb 24 14:01 wpasupplicant -> ../../wpa_supplicant/ifupdown.sh

/etc/network/if-pre-up.d:
total 16
-rwxr-xr-x 1 root root  344 Aug 11  2010 ethtool
lrwxrwxrwx 1 root root   25 Feb 24 14:01 hostapd -> ../../hostapd/ifupdown.sh
-rwxr-xr-x 1 root root   62 Oct 23  2018 unblock-wifi
-rwxr-xr-x 1 root root 4191 Sep 15  2018 wireless-tools
lrwxrwxrwx 1 root root   32 Feb 24 14:01 wpasupplicant -> ../../wpa_supplicant/ifupdown.sh

/etc/network/if-up.d:
total 56
-rwxr-xr-x 1 root root  965 Jan  5  2022 000resolvconf
-rw-r--r-- 1 root root  332 Mar  4 13:25 _psi_warmal
-rw-r--r-- 1 root root  109 Feb 15  2020 _z_check_gvo_dc
-rwxr-xr-x 1 root root 1685 Sep 22  2014 ethtool
-rwxr-xr-x 1 root root   99 Jul 27  2018 ifstats
lrwxrwxrwx 1 root root   17 Mar 12 09:01 jabber -> ../scripts/jabber
-rwxr-xr-x 1 root root  264 Nov 28  2014 ledblink
-rwxr-xr-x 1 root root  537 Aug 22 19:49 monitor
-rwxr-xr-x 1 root root 4938 Feb 20  2021 mountnfs
-rwxr-xr-x 1 root root  415 Oct  3  2019 ntpdate
-rwxr-xr-x 1 root root 1048 Jan 17  2023 ntpsec-ntpdate
-rwxr-xr-x 1 root root  385 Feb 24  2021 openvpn
-rwxr-xr-x 1 root root 4663 Dec  9  2022 resolved
lrwxrwxrwx 1 root root   32 Feb 24 14:01 wpasupplicant -> ../../wpa_supplicant/ifupdown.sh