From: Roy Marples Date: Thu, 8 May 2025 16:26:52 +0000 (+0100) Subject: dhcpcd: fork to background on initial timeout X-Git-Tag: v10.2.3~5 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=9e4a4f3fcfa59f2146efcec3a2e56be645f0a1c6;p=thirdparty%2Fdhcpcd.git dhcpcd: fork to background on initial timeout Unless the -1, --oneshot option is given. dhcpcd should keep on trying to configure the interface. Fixes #423 --- diff --git a/src/dhcpcd.8.in b/src/dhcpcd.8.in index 83f6399d..66818b3a 100644 --- a/src/dhcpcd.8.in +++ b/src/dhcpcd.8.in @@ -522,18 +522,19 @@ option instead. Timeout after .Ar seconds , instead of the default 30. +On timeout, +.Nm +will exit if the +.Fl 1 , +.Fl Fl oneshot +option has been given, +otherwise it will fork into the background and keep on +trying. A setting of 0 .Ar seconds causes .Nm to wait forever to get a lease. -If -.Nm -is working on a single interface then -.Nm -will exit when a timeout occurs, otherwise -.Nm -will fork into the background. .It Fl u , Fl Fl userclass Ar class Tags the DHCPv4 message with the userclass .Ar class . diff --git a/src/dhcpcd.c b/src/dhcpcd.c index 1f0fabb6..3e65141e 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -198,7 +198,7 @@ handle_exit_timeout(void *arg) ctx = arg; logerrx("timed out"); - if (!(ctx->options & DHCPCD_MANAGER)) { + if (ctx->options & DHCPCD_ONESHOT) { struct interface *ifp; TAILQ_FOREACH(ifp, ctx->ifaces, next) {