Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 95130 - udhcp does not have a startup script
Summary: udhcp does not have a startup script
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-05 08:50 UTC by Samuel Penn
Modified: 2005-06-06 17:10 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Penn 2005-06-05 08:50:44 UTC
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 $? 
}
Comment 1 Brian Jackson (RETIRED) gentoo-dev 2005-06-05 11:29:44 UTC
man udhcpd.conf says it writes /var/run/udhcpd.pid by default

Can you verify this?
Comment 2 Samuel Penn 2005-06-05 14:44:39 UTC
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. 
 
Comment 3 SpanKY gentoo-dev 2005-06-05 18:23:20 UTC
udhcp has been integrated into baselayout-1.11.x already
Comment 4 SpanKY gentoo-dev 2005-06-05 19:40:32 UTC
as iggy pointed out, i'm confusing client with server
Comment 5 SpanKY gentoo-dev 2005-06-06 17:10:53 UTC
init.d now in portage, thanks