Move kill-dhclient to netroot
PATCH 1/1 Move kill-dhclient to netroot
We need to kill dhclient before calling switch_root. But doing it in pre-pivot slows down netroot if we are trying do acquire dhcp addresses from multiple interfaces.
If, for example, we have two interfaces and the first one succeeds in acquiring an address and mounts, the second interface might still be trying to acquire an address. Which means that udevadm settle is waiting for the timeout to occur.
Killing all running dhclients in netroot after a successful mount solves this.
modules.d/40network/install +0 -0
@@ -18,7 +18,6 @@ instmods ecb arc4
inst_hook pre-udev 60 "$moddir/net-genrules.sh" inst_hook cmdline 91 "$moddir/dhcp-root.sh" inst_hook cmdline 99 "$moddir/parse-ip-opts.sh" -inst_hook pre-pivot 10 "$moddir/kill-dhclient.sh"
# TODO ifcfg config style is redhat specific, this should probably
# go into its own module at one time
modules.d/40network/kill-dhclient.sh deleted +0 -7
@@ -1,7 +0,0 @@ -#!/bin/sh - -for f in /tmp/dhclient.*.pid; do - [ -e $f ] || continue - read PID < $f; - kill $PID; -done
modules.d/40network/netroot +3 -0
@@ -108,6 +108,10 @@ if $handler $netif $netroot $NEWROOT; then [ -f /tmp/dhclient.$iface.dhcpopts ] && cp /tmp/dhclient.$iface.dhcpopts /tmp/net.$ifa done + # We have root, so we don't need any running dhclients anymore. + # This frees the udev event queue as well + [ -n "$(pidof dhclient)" ] && kill $(pidof dhclient) + # Save used netif for later use [ ! -f /tmp/net.ifaces ] && echo $netif > /tmp/net.ifaces
else --
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html