dhcpcd should not be stopped with /sbin/dhcpcd -k ${IFACE}. During normal shutdown of the system, dhcpcd should be killed with SIGTERM not SIGHUP, as the -k option does. This is described in man dhcpcd: -k Sends SIGHUP signal to the dhcpcd process that is currently running. If dhcpcd receives SIGHUP it will send DCHP_RELEASE message to the server and destroy dhcpcd cache. In a case dhcpcd receives SIGTERM which is normally used by shutdown(8) when rebooting the system dhcpcd will not send DHCP_RELEASE and will not destroy cache. When sys- tem boots dhcpcd will use cache to request the same IP address from DHCP server which was assigned before the system went down. and also in this <a href="http://forums.gentoo.org/viewtopic.php?t=17056">post </a>. /sbin/dhcpcd -k ${IFACE} &>/dev/null should be changed to kill -SIGTERM `cat /var/run/dhcpcd-${IFACE}.pid` &>/dev/null The post recommended kill `pidof dhcpcd`. I'm not sure if this whould work right with multiple network cards. Does a single dhcpcd process handle all devices or one process per device? I see processes named: dhcpcd (/var/run/dhcpcd-eth1.pid) eth0 (static ip) eth1 (dhcp ip) Can someone test out my proposal that has dhcp control 2 or more cards? By the way, which component does this belong in: core system, applications, .... There should be a startup scripts component.
see Bug 2175 for the reason
err, ill let azarah decide ;)
I dont have a problem changing it. Problem though is that I do not use dhcp ... so cannot test this ....
Anybody with dhcp experience willing to vouch on this ?
Ok, what about if we are shutting down the machine (no reboot), we send a SIGHUP, but if we are rebooting, we send a TERM ?
Let's do what you propose in comment #5, if it is easy to detect that. The kill -TERM `cat /var/run/dhcpcd-${IFACE}.pid` should indeed work. Alternative is to not do anything, and let init send the SIGTERM :)
It will need some magic in /sbin/rc, but not too much ;) Ill have a look and attach a patch. Everybody ok if we use 1.8.6.4 as testing ground ?
baselayout-1.8.6.5 should have: HALT=reboot or HALT=shutdown depending on what it is doing. net.eth0 have changed a bit though, so I did not do any changes to it.
Am I correct that the approach proposed is different between whether you shut down or reboot? This is wrong. Whether I reboot or shutdown I always want to request the same IP address. I see only 2 options: 1) Always SIGTERM, so you always keep the same address. If the address you want is not available anymore then you just get a new one anyway. 2) Have a configuration option somewhere where the use indicates his preference e.g. KeepAddress = Yes/No.
dhcpcd-1.3.22_p4-r1 now has a -z option which will allow shutdown of dhcpcd *but* will keep the cache file. So if baselayout starts using -z and depending on the new dhcpcd in some way, this problem should be resolved.
Baselayout now uses -z. Resolving as fixed, as per comment #10