CD, NFSROOT and expiring DHCP lease

Thomas Lange lange at cs.uni-koeln.de
Mon Oct 24 09:10:52 CEST 2022


Hi Andrew,

yes this makes it more worse, I can confirm it.
The new approach will be to stop the initrd from killing dhclient.
Here's the patch, but it's not yet tested:


diff --git a/bin/fai-make-nfsroot b/bin/fai-make-nfsroot
index 3b9fbb6e..02b332a4 100755
--- a/bin/fai-make-nfsroot
+++ b/bin/fai-make-nfsroot
@@ -458,6 +458,7 @@ EOF
     # remove file diversion, then create initrd
     rm $NFSROOT/etc/kernel/postinst.d/dracut
     $ROOTCMD dpkg-divert --rename --remove /etc/kernel/postinst.d/dracut
+    rm -f $NFSROOT/usr/lib/dracut/modules.d/35network-legacy/kill-dhclient.sh
     $ROOTCMD dpkg-reconfigure dracut
 
     set_root_pw



>>>>> On Fri, 20 Aug 2021 20:20:08 +1200, Andrew Ruthven <andrew at etc.gen.nz> said:

    > On Thu, 2021-04-29 at 22:48 +1200, Andrew Ruthven wrote:
    >> Is there an approach so that ISO images created with fai-cd
    >         perform
    >> DHCP lease renewals?
    >         As a workaround, you could write a hook, that starts dhclient.
    >         Since the hooks are on the ISO and will be executed, this should work
    >         until I release a new FAI version with a fix.

    >     Yup, sure thing. I'll see about doing this tomorrow.

    > I can now confirm that this didn't work, in fact it made things worse!

    > Running dhclient caused a second IP to be allocated to the machine being built which then
    > caused the nfsroot to become unreachable.


More information about the linux-fai mailing list