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?
-- Package-specific info:
--- /etc/network/interfaces:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
source-directory interfaces.d
# interfaces without wlan0- prefix get randommac
mapping wlan0
script /home/msdemlei/mybin/wlanmap.py
map 'Sommerfeld' 'wlan0-home'
map 'IstOffen' 'wlan0-homeclear'
map 'uugrn' 'wlan0-fixme'
map 'GegenWLAN' 'gd'
map 'WIFIonICE' 'ice'
map 'WIFI@DB' 'bahnhof'
map 'IVOA-guest' 'wlan0-cfa'
map 'eduroam' 'wlan0-eduroam'
map 'freifunk-rhein-neckar.de' 'wlan0-freifunk'
map 'GEW2' 'wlan0-conf'
map 'Vodafone-9221' 'silke'
map '2 Gaestehaus am Weiher' 'wlan0-captive'
# map 'hamburg.freifunk.net' 'wlan0-freifunk'
map '36C3' 'wlan0-ccc1'
map '36C3-insecure' 'wlan0-ccc'
map 'GEW-Gast' 'wlan0-gew2'
map 'Kleiner Sitzungssaal' 'wlan0-gew'
map 'DBLounge' 'lounge'
map 'YellowHouse' 'wlan0-yh'
map 'ALBAROSA' 'wlan0-roam2'
map 'Kollontai' 'wlan0-ursula'
map 'neuschwanstein' 'wlan0-explo'
map 'FRITZ!Box Fon Emma 10' 'wlan0-elli'
map 'kleister' 'wlan0-wald'
map 'WLAN-B6F340' 'wlan0-igm'
map 'freeWIFIahead!' 'wlan0-ahead'
map 'AFWLAN' 'wlan0-angela'
map 'jfg65tgbh643her6' 'wlan0-willi'
map 'maxspot (FREE)' 'wlan0-maxspot'
map 'Fuenfseenblick' 'wlan0-fuenf'
map 'o2-WLAN53' 'wlan0-angie'
map 'EasyBox-E8FF65' 'wlan0-wolfgang'
map 'FRITZ!Box Fon WLAN 7113' 'wlan0-mic'
# map 'FRITZ!Box Fon WLAN 7141' 'wlan0-martin'
map 'Gott' 'wlan0-conny'
map 'r215.thk.6gb' 'wlan0-thomas'
map 'R215.thk' 'wlan0-thomas2'
map 'KabelBox-CAF9' 'wlan0-claudia'
iface wlan0-dhcp inet dhcp
pre-up modprobe iwlwifi
wireless-essid IstOffen
iface eth0 inet dhcp
pre-up modprobe e1000e
post-down rmmod e1000e
# access maintenance interfaces within ARI
iface eth0:1 inet static
address 10.3.3.54
netmask 255.255.255.0
iface eth0-demo inet static
# use "netshare eth0 <upstream>" to share an upstream connection
pre-up modprobe e1000e
address 192.168.20.1
netmask 255.255.255.0
post-up dhcpd eth0
pre-down killall dhcpd
post-down rmmod e1000e
iface eth0-sp inet static
pre-up modprobe e1000e
address 192.168.178.100
netmask 255.255.255.0
dns-nameservers 192.168.178.1
post-down rmmod e1000e
iface o2 inet ppp
provider o2
iface n900 inet ppp
pre-up /usr/local/sbin/bluenet start
provider bluez
post-down /usr/local/sbin/bluenet stop
iface serial inet ppp
provider n900-serial
iface wwan0 inet dhcp
iface wlan0-ccc inet dhcp
wireless-essid 36C3-insecure
iface wlan0-ccc1 inet dhcp
wpa-essid 36C3
wpa-scan-ssid 1
wpa-key-mgmt WPA-EAP
wpa-eap TTLS
wpa-identity guest
wpa-password guest
wpa-phase2 auth=PAP
iface wlan0-host inet static
address 192.168.20.1
netmask 255.255.255.0
pre-up modprobe iwlwifi
wireless-mode master
wireless-essid RH
iface eth0-static inet static
# hackish interface for just grabbing an IP
pre-up modprobe e1000e
post-up route add default gw 10.206.116.17
address 10.206.116.198
netmask 255.255.255.0
dns-search stura.uni-heidelberg.de
dns-nameservers 10.206.116.30
post-down rmmod e1000e
iface eth0-ari inet static
pre-up modprobe e1000e
post-up route add default gw 129.206.110.1
address 129.206.110.59
netmask 255.255.255.0
dns-search ari.uni-heidelberg.de
dns-nameservers 129.206.112.100 129.206.100.126
post-down rmmod e1000e
# in ari, behind ret
iface eth0-ret inet static
pre-up modprobe e1000e
# don't resume wlan0 when docked
pre-up rm -f /run/ifstate.resume
pre-up ifdown wlan0 || true
address 129.206.110.59
netmask 255.255.255.255
mtu 4096
post-up route add -host 129.206.110.156 dev eth0
post-up route add default gw 129.206.110.156
# post-up route add default gw 129.206.110.1
dns-nameservers 129.206.112.100 129.206.100.126
dns-search ari.uni-heidelberg.de
pre-down route del default gw 129.206.110.156
pre-down route del -host 129.206.110.156 dev eth0
post-down rmmod e1000e
# uni, vpnc
iface wlan0-vpnc inet dhcp
wireless-essid UNI-HEIDELBERG
post-up /usr/sbin/vpnc-connect /etc/vpnc.conf
pre-down /usr/sbin/vpnc-disconnect
allow-hotplug usb0
iface usb0 inet static
post-up /home/msdemlei/mybin/netshare -u usb0 wlan0
## post-up su - msdemlei -c /home/msdemlei/mybin/sync-stinker
address 192.168.20.1
netmask 255.255.255.0
pre-down /home/msdemlei/mybin/netshare -d usb0 wlan0
# That's the Cat B40 as renamed in 70-persistent-net.rules
allow-hotplug wwan1
iface wwan1 inet dhcp
iface wlan0-uni inet dhcp
pre-up modprobe iwlwifi
wireless-essid UNI-HEIDELBERG
post-down ifconfig wlan0 hw ether e8:b1:fc:dc:5c:35
# wireless, Home
iface wlan0-home inet static
pre-up modprobe iwlwifi
pre-up sleep 1
wpa-essid Sommerfeld
wpa-psk Arnoldskonstante
address 192.168.178.32
netmask 255.255.255.0
gateway 192.168.178.1
dns-nameservers 192.168.178.1
post-down ifconfig wlan0 hw ether e8:b1:fc:dc:5c:35
# wireless unencrypted, Home
iface wlan0-homeclear inet dhcp
wireless-essid IstOffen
# usb-wireless, Home
iface wlan1 inet static
wpa-essid Sommerfeld
wpa-psk Arnoldskonstante
address 192.168.178.32
netmask 255.255.255.0
gateway 192.168.178.1
dns-nameservers 192.168.178.1
# wireless, Uni-VPNC
iface wlan0-wl inet dhcp
pre-up modprobe iwlwifi
pre-up iwconfig wlan0 essid UNI-HEIDELBERG
iface wlan0-explo inet dhcp
pre-up modprobe iwlwifi
wpa-ssid neuschwanstein
wpa-psk Nesselwang
iface wlan0-kio inet dhcp
pre-up modprobe iwlwifi
wireless-essid kio_246
wireless-key 47-65-6f-72-67-65-20-4f-72-77-65-31-31
# Tunnel for vpnc
iface tun0 inet dhcp
iface wlan0-martin inet dhcp
pre-up modprobe iwlwifi
wpa-ssid "FRITZ!Box Fon WLAN 7141"
wpa-psk 1900817799239139
wireless-nick victor
iface wlan0-leech28 inet dhcp
pre-up modprobe iwlwifi
wireless-essid NICO
wireless-key "7921082792108"
iface wlan0-ahead inet dhcp
wireless-essid freeWIFIahead!
post-down ifconfig wlan0 hw ether e8:b1:fc:dc:5c:35
iface wlan0-wald inet dhcp
wpa-ssid kleister
wpa-psk 75Waknasupta)
post-down ifconfig wlan0 hw ether e8:b1:fc:dc:5c:35
iface wlan0-elli inet dhcp
wpa-ssid FRITZ!Box Fon Emma 10
wpa-psk 75000720561924974842
post-down ifconfig wlan0 hw ether e8:b1:fc:dc:5c:35
iface wlan0-kts inet dhcp
pre-up modprobe iwlwifi
wireless-essid fr-wlan-xmas-3
iface wlan0-willi inet dhcp
wpa-ssid jfg65tgbh643her6
wpa-psk 4510492483187639
post-down ifconfig wlan0 hw ether e8:b1:fc:dc:5c:35
iface wlan0-angela inet dhcp
wpa-ssid AFWLAN
wpa-psk calexico
post-down ifconfig wlan0 hw ether e8:b1:fc:dc:5c:35
iface gd inet dhcp
wpa-ssid GegenWLAN
wpa-psk WLAN@ALL
# wpa-essid gd-intern
# wpa-psk IstEsNichtMeineRevolution
iface wlan0-maxspot inet dhcp
wireless-essid maxspot (FREE)
post-down ifconfig wlan0 hw ether e8:b1:fc:dc:5c:35
iface wlan0-fixme inet dhcp
wpa-essid uugrn
wpa-psk UUGRN.ORG
post-down ifconfig wlan0 hw ether e8:b1:fc:dc:5c:35
iface wlan0-eduroam inet dhcp
wpa-ssid eduroam
wpa-key-mgmt WPA-EAP
wpa-eap TTLS
wpa-identity o...@uni-heidelberg.de
wpa-password nurk8buz
wpa-phase2 auth=MSCHAPV2
# wpa-phase2 auth=PEAP
wpa-anonymous-identity eduroamH...@uni-heidelberg.de
post-down ifconfig wlan0 hw ether e8:b1:fc:dc:5c:35
# wpa-bssid d8:84:66:10:44:da
# wpa-scan-ssid 1
# additional junk from script
# wpa-pairwise CCMP
# wpa-group CCMP TKIP
# if cert-checking
# wpa-ca-cert ....
# wpa-altsubject-match DNS:radius-node1.urz.uni-heidelberg.de
# RWTH aachen workaround
# post-up route add default gw 134.61.104.1
# wpa-ca_path /etc/ssl/certs
# wpa-auth_alg OPEN
iface wlan0-igm inet dhcp
wpa-essid WLAN-B6F340
wpa-psk B6F3C8
iface dsl-provider inet ppp
pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf
provider dsl-provider
iface wlan0-fsk inet dhcp
wireless-essid freifunk-rhein-neckar.de
iface eth4 inet static
# edimax pc card, used here for configuring the router
address 192.168.168.7
netmask 255.255.255.0
iface wlan0-wolfgang inet dhcp
wpa-ssid EasyBox-E8FF65
wpa-psk 796154114
iface wlan0-cfa inet dhcp
wpa-essid IVOA-guest
wpa-psk IVOA-Bologna2023!
iface wlan0-conf inet dhcp
wpa-essid GEW2
wpa-psk GEW!2022gl
post-down ifconfig wlan0 hw ether e8:b1:fc:dc:5c:35
# wireless-ap 04:9F:CA:93:5A:E0
iface wlan0-roam2 inet dhcp
wpa-essid ALBAROSA
wpa-psk vito2014
iface wlan0-fuenf inet dhcp
wpa-ssid Fuenfseenblick
wpa-psk willkommen
iface wlan0-mic inet dhcp
wpa-essid FRITZ!Box Fon WLAN 7113
wpa-psk micimacko
iface wlan0-conny inet dhcp
wpa-essid Gott
wpa-psk gk180958
iface wlan0-victor inet dhcp
# for testing access point victor
wireless-essid victor
iface wlan0-angie inet dhcp
wpa-essid o2-WLAN53
wpa-psk 5936802661553444
iface wlan0-ursula inet dhcp
wpa-essid Kollontai
wpa-psk Pearlsofglass
iface wlan0-thomas inet dhcp
wpa-essid r215.thk.6gb
wpa-psk -Zur5e!o9
iface wlan0-thomas2 inet dhcp
wpa-essid R215.thk
wpa-psk wuhwuhwuh
iface wlan0-yh inet dhcp
# 98:39:8E:F2:D6:19 2C:F0:EE:31:2D:52 44:1C:A8:E4:1F:E9 DC:A4:CA:0A:3B:19
# pre-up ifconfig wlan0 down
# pre-up ifconfig wlan0 hw ether 2C:F0:EE:31:2D:52
wpa-essid YellowHouse
wpa-psk recovery2013
iface wlan0-freifunk inet dhcp
wireless-essid freifunk-rhein-neckar.de
iface telekom inet dhcp
wireless-essid Telekom
post-down ifconfig wlan0 hw ether e8:b1:fc:dc:5c:35
iface wlan0-martin inet dhcp
wpa-essid FRITZ!Box Fon WLAN 7141
wpa-psk 1900817799239139
iface wlan0-claudia inet dhcp
wpa-essid KabelBox-CAF9
wpa-psk 03745021856145399024
iface wlan0-gew inet dhcp
wpa-essid Kleiner Sitzungssaal
wpa-psk gewbw2007
iface wlan0-gew2 inet dhcp
wpa-essid GEW-Gast
wpa-psk gewbw2020
iface wlan0-ap inet static
post-up dhcpd wlan0
# ifupdown hostap appears to be borken in stretch...
post-up hostapd /etc/hostapd/hostapd.conf &
post-down killall hostapd
address 192.168.20.1
netmask 255.255.255.0
post-down killall dhcpd
iface wlan0-adhoc inet static
pre-up ip link set wlan0 down
pre-up iw wlan0 set type ibss
pre-up ip link set wlan0 up
pre-up iw dev wlan0 ibss join victor 2447
address 192.168.20.1
netmask 255.255.255.0
iface ice inet dhcp
wireless-essid WIFIonICE
post-up /usr/local/sbin/bahnlogin.sh wlan0 up
post-down ifconfig wlan0 hw ether e8:b1:fc:dc:5c:35
iface lounge inet dhcp
wireless-essid DBLounge
post-down ifconfig wlan0 hw ether e8:b1:fc:dc:5c:35
iface wlan0-captive inet dhcp
wpa-essid 2 Gaestehaus am Weiher
wpa-psk LDULRHSTUGZSGJVO
post-down ifconfig wlan0 hw ether e8:b1:fc:dc:5c:35
# post-up curl -L -d username=hotel1 -d password=4596 -d dst=http://www.tfiu.de -d x=0 -d y=0 -d popup=true http://hotspot.server/login
iface bahnhof inet dhcp
wireless-essid WIFI@DB
post-down ifconfig wlan0 hw ether e8:b1:fc:dc:5c:35
iface silke inet dhcp
wpa-essid Vodafone-9221
wpa-psk GrrMbHFTPBTc7rH6
post-down ifconfig wlan0 hw ether e8:b1:fc:dc:5c:35
--- 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
-- System Information:
Debian Release: 12.1
APT prefers stable-security
APT policy: (500, 'stable-security'), (500, 'oldstable-updates'), (500, 'stable')
Architecture: i386 (x86_64)
Kernel: Linux 6.1.38 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_OOT_MODULE
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages ifupdown depends on:
ii adduser 3.134
ii iproute2 6.1.0-3
ii libc6 2.36-9+deb12u1
Versions of packages ifupdown recommends:
ii isc-dhcp-client [dhcp-client] 4.4.3-P1-2
Versions of packages ifupdown suggests:
ii ppp 2.4.9-1+1.1+b1
pn rdnssd <none>
-- debconf information:
ifupdown/convert-interfaces: true