udhcp, whilst being a nice and simple DHCP server, does not have an init script to automatically start it. This causes problems when the machine is restarted because someone has to remember to restart the udhcp process by hand. Reproducible: Always Steps to Reproduce: 1.emerge udhcp 2.notice that there is no entry in /etc/init.d for udhcp Actual Results: No results seen. Expected Results: The ebuild would have provided an init script of some kind. I took the init script from rsyncd, and modified it to start udhcpd. It's very noddy, but it seems to do the job. Currently running on my server, so maybe this can be used as a base for the real script (the pkill is bad, I know, but it works for me. Probably need to save the pid of the process somewhere when it is started). #!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 depend() { use net } start() { ebegin "Starting udhcpd" udhcpd eend $? } stop() { ebegin "Stopping rsyncd" pkill udhcpd eend $? }
man udhcpd.conf says it writes /var/run/udhcpd.pid by default Can you verify this?
There is a /var/run/udhcpd.pid, which contains its pid. 'man udhcpd' does not mention a pid file, which is why I missed that. I guess the pkill can be replaced with an almost exact copy from rsyncd: start-stop-daemon --stop --pidfile /var/run/udhcpd.pid Though this wouldn't cope with someone changing the location of the pidfile from the config. Looking at the rsyncd configuration however, that also allows the location of the pidfile to be changed, which also breaks it for the rsyncd init script.
udhcp has been integrated into baselayout-1.11.x already
as iggy pointed out, i'm confusing client with server
init.d now in portage, thanks