Networking Forums

Networking Forums > Computer Networking > Linux Networking > dhcpd in rc script doesn't start, but it does start by hand

Reply
Thread Tools Display Modes

dhcpd in rc script doesn't start, but it does start by hand

 
 
j
Guest
Posts: n/a

 
      11-05-2003, 01:30 AM
The title says it all- I have a single /etc/rc script that starts the
machine, invoked by inittab with the line

si::sysinit:/etc/rc

The last line of this script is

/usr/sbin/dhcpd

When the machine starts, all messages indicate that dhcpd is running
(on the screen and in /var/log/messages), but ps -Af does not show
dhcpd running, and external machines can not get dhcp addresses.

I am trying to debug this, but the frustrating thing is that in every
debug test I have ran, dhcp works! In particular:

1). It works when I put a "sleep 2" after the dhcpd start in
rc (but this seems like the wrong way to go about fixing this).

2). When I type /usr/sbin/dhcpd by hand in bash, it works.

3). When I boot into single user mode and run /etc/rc by hand,
it also works.

4). When I start dhcpd with strace in /etc/rc, it also works.

Because dhcpd works in every debug test I have tried, I am running out
of ideas on how to debug this.

thanks
-J
 
Reply With Quote
 
 
 
 
Gareth Ansell
Guest
Posts: n/a

 
      11-05-2003, 08:17 AM
On Tue, 04 Nov 2003 18:30:28 -0800, j wrote:

> The title says it all- I have a single /etc/rc script that starts the
> machine, invoked by inittab with the line
>
> si::sysinit:/etc/rc
>
> The last line of this script is
>
> /usr/sbin/dhcpd
>
> When the machine starts, all messages indicate that dhcpd is running (on
> the screen and in /var/log/messages), but ps -Af does not show dhcpd
> running, and external machines can not get dhcp addresses.
>
> I am trying to debug this, but the frustrating thing is that in every
> debug test I have ran, dhcp works! In particular:
>
> 1). It works when I put a "sleep 2" after the dhcpd start in
> rc (but this seems like the wrong way to go about fixing this).
>
> 2). When I type /usr/sbin/dhcpd by hand in bash, it works.
>
> 3). When I boot into single user mode and run /etc/rc by hand,
> it also works.
>
> 4). When I start dhcpd with strace in /etc/rc, it also works.
>
> Because dhcpd works in every debug test I have tried, I am running out
> of ideas on how to debug this.
>
> thanks
> -J

The only thing I can thing of that might help would be a look at the
syslog files (the /var /log/messgaes files only seems to record the
'happy' events, whereas syslog will record the failures. first grep them
for dhcp and see what occurs. dhcpd is very informative about errors,
spewing out copious error messages. But make sure that the -q option is
not present in the rc script as this will put it into quite mode.

In my experience if dhcp is failing to start correctly, due to a
configuration problem it would be fairly obvious.

Gareth Ansell
 
Reply With Quote
 
Neil Horman
Guest
Posts: n/a

 
      11-05-2003, 11:51 AM
j wrote:
> The title says it all- I have a single /etc/rc script that starts the
> machine, invoked by inittab with the line
>
> si::sysinit:/etc/rc
>
> The last line of this script is
>
> /usr/sbin/dhcpd
>
> When the machine starts, all messages indicate that dhcpd is running
> (on the screen and in /var/log/messages), but ps -Af does not show
> dhcpd running, and external machines can not get dhcp addresses.
>
> I am trying to debug this, but the frustrating thing is that in every
> debug test I have ran, dhcp works! In particular:
>
> 1). It works when I put a "sleep 2" after the dhcpd start in
> rc (but this seems like the wrong way to go about fixing this).
>
> 2). When I type /usr/sbin/dhcpd by hand in bash, it works.
>
> 3). When I boot into single user mode and run /etc/rc by hand,
> it also works.
>
> 4). When I start dhcpd with strace in /etc/rc, it also works.
>
> Because dhcpd works in every debug test I have tried, I am running out
> of ideas on how to debug this.
>
> thanks
> -J

What happens when you run the rc script by hand? If it does not start I
suggest that you place the line:
set -x
at the top of the rc script, right below the #!/bin/sh line. This will
cause every command in the script to get echoed to the console so that
you can see its result.

HTH
Neil

--
/************************************************** *
*Neil Horman
*Software Engineer
*Red Hat, Inc., www.redhat.com
*gpg keyid: 1024D / 0x92A74FA1
*http://www.keyserver.net
************************************************** */

 
Reply With Quote
 
Gareth Ansell
Guest
Posts: n/a

 
      06-08-2004, 12:30 PM
On Tue, 04 Nov 2003 18:30:28 -0800, j wrote:

> The title says it all- I have a single /etc/rc script that starts the
> machine, invoked by inittab with the line
>
> si::sysinit:/etc/rc
>
> The last line of this script is
>
> /usr/sbin/dhcpd
>
> When the machine starts, all messages indicate that dhcpd is running
> (on the screen and in /var/log/messages), but ps -Af does not show
> dhcpd running, and external machines can not get dhcp addresses.
>
> I am trying to debug this, but the frustrating thing is that in every
> debug test I have ran, dhcp works! In particular:
>
> 1). It works when I put a "sleep 2" after the dhcpd start in
> rc (but this seems like the wrong way to go about fixing this).
>
> 2). When I type /usr/sbin/dhcpd by hand in bash, it works.
>
> 3). When I boot into single user mode and run /etc/rc by hand,
> it also works.
>
> 4). When I start dhcpd with strace in /etc/rc, it also works.
>
> Because dhcpd works in every debug test I have tried, I am running out
> of ideas on how to debug this.
>
> thanks
> -J

Th eonly thing I can thing of that might help would be a look at the
syslog files (the /var /log/messgaes files only seems to record the
'happy' events, whereas syslog will record the failures. first grep them for dhcp and see what occurs.
dhcpd is very informative about errors, spewing out copious error
messages. But make sure that the -q option is not present in the rc
script as this will put it into quite mode.

In my experience if dhcp is failing to start correctly, due to a
configuration problem it would be fairly obvious.

Gareth Ansell
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FPNW service doesn not start Stefano Colombo Windows Networking 0 07-12-2007 10:35 AM
server 2k gpo/script won't start on clients alex01 Windows Networking 0 03-22-2007 11:08 AM
ISC DHCPD V3.0p12 refuses to start Grant Linux Networking 2 10-22-2005 01:49 AM
RH9: I need to start ADSL-START as root for the first time after boot .... Gabolander Linux Networking 3 08-13-2003 09:52 AM
how to run script after adsl-start 0 Linux Networking 4 07-30-2003 06:36 PM



1 2 3 4 5 6 7 8 9 10 11