NetBSD-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: System fails to start dhclient at boot after upgrade 6.1.5 -> 7.0.1
Unfortunately, I took the advice of the mailing list and switched to
dhcpcd because I was told it is the new standard dhcp client.
Side note: All the NetBSD documentation still seems to recommend
dhclient. If David and Robert are correct about dhcpcd, then there
seems to be something strange going on. Why are there two default dhcp
clients and what exactly are the criteria for choosing one or the other?
Does the new installer address this?
Anyway, as much as I understand (or misunderstand!) your diff, it sounds
to be along the right path. I can clearly remember the RC processing
pausing for dhclient in the past, because when my cable went out the
boot would wait for several minutes unless I ctrl-C'd. My assumption
was that in NetBSD 7, either the RC dependency graph was messed up or
dhclient was breaking off to become a daemon before acquiring an IP
address. Since dhcpcd had the same problem I figured it was RC but a
cursory look at the dependencies doesn't reveal any issue.
Your change, does it fix something that was added after NetBSD 6? To be
honest I don't know how to recompile and update only dhclient and
nothing else. I'm used to using build.sh for system upgrades. Still
I'll try to run your patch over the weekend. I have been having crashes
lately and one of my adapters fails to get assigned its static IP when
the system reboots, so I have to roll up my sleeves and look at that
anyway. These issues really contribute to my updated system not
"feeling" like NetBSD, so I want to resolve them.
On Fri, Jul 22, 2016, at 07:22 PM, Timo Buhrmester wrote:
> Can you try the below patch? I've ran into this by accident but haven't
> gotten around to file a PR yet. I'm also not sure if this is relevant
> to you problem, but it sure is a wait-for-something mechanism that
> couldn't possibly work because it had its pipe ends switched so far.
>
> (from pipe(2): The first descriptor connects to the read end of the pipe,
> and the second connects to the write end)
>
> --- external/bsd/dhcp/dist/client/dhclient.c.orig
> +++ external/bsd/dhcp/dist/client/dhclient.c
> @@ -3701,8 +3701,8 @@ void finish_daemon (void)
> write_client_pid_file ();
>
> IGNORE_RET (chdir("/"));
> - write(pfd[0], "X", 1);
> - close(pfd[0]);
> + write(pfd[1], "X", 1);
> + close(pfd[1]);
> }
>
> void go_daemon (void)
> @@ -3723,11 +3724,11 @@ void go_daemon (void)
> log_fatal ("Can't fork daemon: %m");
> else if (pid) {
> char c;
> - close(pfd[0]);
> - read(pfd[1], &c, 1);
> + close(pfd[1]);
> + read(pfd[0], &c, 1);
> exit (0);
> } else
> - close(pfd[1]);
> + close(pfd[0]);
> }
>
> void write_client_pid_file ()
Home |
Main Index |
Thread Index |
Old Index