In case network was requested, but the host lacks both dhclient and
dhcpcd, skip the loop which waits for a resolv.conf update.

This reduces boot time by 10 seconds.

Signed-off-by: Olaf Hering <o...@aepfle.de>
---

Not runtime tested.


 appliance/init | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/appliance/init b/appliance/init
index cb200d5bf..128a3c20e 100755
--- a/appliance/init
+++ b/appliance/init
@@ -119,8 +119,7 @@ if test "$guestfs_network" = 1; then
     rm -f /etc/dhcp/dhclient-enter-hooks.d/resolved
     if dhclient --version >/dev/null 2>&1; then
         dhclient $iface
-    else
-        dhcpcd $iface
+    elif dhcpcd $iface; then
         # https://github.com/NetworkConfiguration/dhcpcd/issues/258
         for i in `seq 0 10`; do
             if grep nameserver /etc/resolv.conf; then break; fi
_______________________________________________
Libguestfs mailing list -- guestfs@lists.libguestfs.org
To unsubscribe send an email to guestfs-le...@lists.libguestfs.org

Reply via email to