[Bug 1813394] Re: DROPBEAR_IFDOWN=* takes interface down but leaves netplan config
MartinRunge
1813394 at bugs.launchpad.net
Tue Dec 7 13:35:42 UTC 2021
The same problem occurs when the hdd is automatically decrypted with
clevis and a tang server. The script /usr/share/initramfs-
tools/scripts/local-bottom/clevis tries to deactivate the network
interface again after it got the secret to decrypt the disk from the
tang server:
...
for iface in /sys/class/net/*; do
if [ -e "$iface" ]; then
iface=$(basename "$iface")
ip link set dev "$iface" down
ip addr flush dev "$iface"
ip route flush dev "$iface"
fi
done
The presence of /run/net-*.conf and /run/netplan/*.yaml leads to the
interface beeing managed by systemd-networkd instad of NetworkManager
here, too.
Instead of implementing removal of the files in dropbear an clevis,
maybe there is a single place to serve both, dropbear and clevis?
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to initramfs-tools in Ubuntu.
https://bugs.launchpad.net/bugs/1813394
Title:
DROPBEAR_IFDOWN=* takes interface down but leaves netplan config
Status in clevis package in Ubuntu:
New
Status in dropbear package in Ubuntu:
Confirmed
Status in initramfs-tools package in Ubuntu:
Confirmed
Bug description:
On bionic, setting the network interface up (e.g. eno1) with DHCP now
causes a /run/netplan/eno1.yaml and a /run/net-eno1.conf file to be
written. The former gets imported by netplan after boot and causes the
DHCP lease from the initrd to be around forever, which I think goes
against the intent of DROPBEAR_IFDOWN=*.
I have brewed up a workaround script that lives in /etc/initramfs-
tools/scripts/init-bottom/hack-delete-netif-netplan.sh for now:
#### ---- 8< cut >8 --------
#!/bin/sh
PREREQ=""
prereqs() {
echo "$PREREQ"
}
case "$1" in
prereqs)
prereqs
exit 0
;;
esac
. /scripts/functions
log_begin_msg "Deleting all network configuration that systemd could try to import"
rm /run/net-*.conf
rm /run/netplan/*.yaml
log_end_msg
#### ---- 8< cut >8 --------
I think that dropbear-intiramfs's init-bottom script should do this in
addition to downing the interfaces that it finds via the
DROPBEAR_IFDOWN pattern. Do you agree?
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/clevis/+bug/1813394/+subscriptions
More information about the foundations-bugs
mailing list