Dhclient is nowadays waiting for the link to come up before continuing. That makes the -b (become a daemon immediately) less useful. Ctrl-C at that point makes the whole rc.d script fail. Fix: Move the checking for link (/usr/src/sbin/dhclient/dhclient.c) after the first go_daemon case. Problems might be chroot and fork_privchild. Untested. How-To-Repeat: Set background_dhclient="YES" in rc.conf, remove ethernet plug (I assume that it is a rl0 iface) and run /etc/rc.d/netif restart rl0 Notice the long wait.
Currently, the "no link"-timeout is wired-in (10 seconds) in line 364. It's probably the best solution to add a linkdown-timeout-option to dhclient.conf where the timeout can be set (as all the other timeouts).
State Changed From-To: open->suspended Mark suspended awaiting patches.
I actually did a patch quite some time ago. Below a block of code is simply moved from one spot to another. Index: dhclient.c =================================================================== --- dhclient.c (revision 184060) +++ dhclient.c (working copy) @@ -371,22 +371,6 @@ read_client_conf(); - if (!interface_link_status(ifi->name)) { - fprintf(stderr, "%s: no link ...", ifi->name); - fflush(stderr); - sleep(1); - while (!interface_link_status(ifi->name)) { - fprintf(stderr, "."); - fflush(stderr); - if (++i > 10) { - fprintf(stderr, " giving up\n"); - exit(1); - } - sleep(1); - } - fprintf(stderr, " got link\n"); - } - if ((nullfd = open(_PATH_DEVNULL, O_RDWR, 0)) == -1) error("cannot open %s: %m", _PATH_DEVNULL); @@ -438,6 +422,22 @@ if (immediate_daemon) go_daemon(); + if (!interface_link_status(ifi->name)) { + fprintf(stderr, "%s: no link ...", ifi->name); + fflush(stderr); + sleep(1); + while (!interface_link_status(ifi->name)) { + fprintf(stderr, "."); + fflush(stderr); + if (++i > 10) { + fprintf(stderr, " giving up\n"); + exit(1); + } + sleep(1); + } + fprintf(stderr, " got link\n"); + } + ifi->client->state = S_INIT; state_reboot(ifi);
State Changed From-To: suspended->open Patch received.
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped
Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>