Debian init.d script won't start service
glenn.satchell at uniq.com.au
Sun Jan 16 03:13:53 UTC 2011
A good way to test shell script is to use
sh -x /etc/init.d/dhcp3-server start
The sh -x echoes each line after expanding variables. Allows you to see
what is happenning in each line of code. In this case it would have
found the 'exit 0' very quickly.
On 01/15/11 11:31, Tim Gavin wrote:
> I found that uncommented section a couple of minutes ago :-D Fixed it
> and the script works again now.
> As to why I commented it out, the server is a DHCP server, it's only
> purpose in life is to hand out DHCP. I have multiple VLANs on one of the
> interfaces, and don't want to have to track down that /etc/default
> script to add new ones when the DHCP server itself has an excellent way
> of deciding which interfaces to listen on by default.
> That file (/etc/default/dhcp3-server) has caused me more problems than
> any other factor, so I kill it :) I can never remember to look for it,
> since it's such a rare occurrence that it needs changing. I'd really
> like to see that microscript in /etc/default go away, since it appears
> to serve no other purpose than to do something that is already done
> elsewhere, and causes things to fail in very unpredictable ways.
> Thanks for looking at it. My sanity is restored.
> On 01/14/2011 04:19 PM, Bob Proulx wrote:
>> Tim Gavin wrote:
>>> Can anyone look at this and tell me what's wrong with it?:
>> You have only partially commented out a section (which probably
>> shouldn't be commented out).
>>> # It is not safe to start if we don't have a default configuration...
>>> #if [ ! -f /etc/default/dhcp3-server ]; then
>>> # echo "/etc/default/dhcp3-server does not exist! - Aborting..."
>>> # echo "Run 'dpkg-reconfigure dhcp3-server' to fix the problem."
>>> exit 0
>> That 'exit 0' there is exiting your script at that point.
>> Why comment out the surrounding parts? It should work just fine with
>> the /etc/default/dhcp3-server file. It defines the INTERFACES
>> variable, which is just empty by default.
More information about the dhcp-users