Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Problems with dhcpcd



> I've installed 10.99.9 from about a day ago onto an old Raspberry Pi and I just can't get it to correctly set its hostname from DHCP. (I have removed the hostname=rpi from /etc/rc.conf).
> What I have discovered so far is that if I manually run "dhcpcd -d" then no hostname gets set. If I run "dhcpcd -d -B" then the hostname does get set. This doesn't make sense.

You're correct, this does not make sense.

> Here are the logs from the failed run (console and /var/log/messages). Dhcpcd doesn't seem to be running the hooks for the "CARRIER", which is something that does happen with dhcpcd -d -B". Interestingly, the message "executing: /libexec/dhcpcd-run-hooks ..." is not logged to syslog by either invocation of dhcpcd.

syslog.conf doesn't log debug messages to /var/log/messages by default - you need to enable that.
An alternative is to put `logfile /var/log/dhcpcd.log` into /etc/dhcpcd.conf and look there.

> Sep 30 22:15:40  dhcpcd[331]: usmsc0: rebinding lease of 10.0.1.53
> Sep 30 22:15:46  dhcpcd[331]: usmsc0: leased 10.0.1.53 for 86400 seconds
> Sep 30 22:15:52  dhcpcd[331]: usmsc0: adding route to 10.0.1.0/24
> Sep 30 22:15:52  dhcpcd[331]: usmsc0: adding default route via 10.0.1.1

So it took 12 seconds to complete the DHCP transaction and validate the addresses are good before applying the DHCP lease.
Without -B, dhcpcd will fork to the background right away so any assignments from the DHCP lease won't apply right away.

Is this what you are seeing? Is the hostname even there? You can examine the contents of your leases with `dhcpcd -U`.

I have only just imported dhcpcd-10.0.3 to -current.
Unlikely to address this exact issue (if there is one yet), but you never know.

Roy Marples



Home | Main Index | Thread Index | Old Index