]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dhclient initqueue hook fix
authorDave Young <dyoung@redhat.com>
Mon, 9 Jul 2012 06:56:35 +0000 (14:56 +0800)
committerHarald Hoyer <harald@redhat.com>
Mon, 9 Jul 2012 10:03:55 +0000 (12:03 +0200)
dhclient initqueue hook fix

setup_net is scheduled in initqueue, sometimes it does not get chance to run
So the default route will not be set properly

Add a check in initqueue/finished to resolve this issue.

Signed-off-by: Dave Young <dyoung@redhat.com>
modules.d/40network/dhclient-script.sh

index 470444ebca1e1263aac5bfc1fae4569ede8b968c..1500fe51bd4a0a75e3a8d64de533baee3c6e06d6 100755 (executable)
@@ -88,9 +88,11 @@ case $reason in
             echo "setup_net $netif"
             echo "source_hook initqueue/online $netif"
             [ -e /tmp/net.$netif.manualup ] || echo "/sbin/netroot $netif"
+            echo "> /tmp/setup_net_$netif.ok"
             echo "rm -f $hookdir/initqueue/setup_net_$netif.sh"
         } > $hookdir/initqueue/setup_net_$netif.sh
 
+        echo "[ -f /tmp/setup_net_$netif.ok ]" > $hookdir/initqueue/finished/dhclient-$netif.sh
         >/tmp/net.$netif.up
         ;;
     *) echo "dhcp: $reason";;