# dhcpd not working at boot time [SOLVED]

## nein

Hi,

 I just noticed that the dhcpd server does not get up during boot time (I can see the !! symbols at the end of the corresponding boot line) but I can start it without any problems after the boot process finishes. I have checked the system logs and I  see no error corresponding to dhcpd.

I have already installed the latest version of dhcpcd but it made no difference. Because I have not rebooted my computer during months I have no idea what update caused this problem.

Any ideas ?Last edited by nein on Wed Jul 20, 2005 12:32 pm; edited 1 time in total

----------

## katsiki

Did you configure /etc/conf.d/net for DHCP according to the 2005.0 Handbook?

----------

## nein

Thanks for your replay.

My system has been working for more than 1 year without problems and I have not changed anything in the net configuaration for a long time. I had a look at the info you pointed out but did not find anything that could be related to my problem.

----------

## katsiki

I was taking a guess that if you had not updated for a long time, and just now emerged major changes, then maybe you need to run etc-update.  Maybe your old configuration files are no longer valid.

----------

## nein

I have read again my post I I think it is not clear at all.

My problem is that the dhcp *server* does not start at boot time but it starts after loggin in and starting it manually with /etc/init.d/dhcp start. 

I have no problems with the client. 

Thanks in advance

----------

## katsiki

I'm sorry!  I had not read your post correctly.  I wonder if there may be a minor scheduling problem with the kernel.  I noticed that sysklogd sometimes needs to make use of a restart loop in its init.d script to attempt starting the klogd service a couple times at boot.

Maybe you can try diagnosing the problem by inserting a delay.  I have never installed dhcpd, but maybe this entry of the default /etc/init.d/sysklogd runscript can help you to test.

```
start() {

        start_daemon "syslogd" "${SYSLOGD}" || return 1

 

        # klogd do not always start proper if started too early

        sleep 1

 

        start_daemon "klogd" "${KLOGD}" || {

                if [[ -n $(pidof syslogd) ]] ; then

                        stop_daemon "syslogd"

                fi

                return 1

        }

 

        return 0

}

```

----------

## katsiki

I hope I didn't ruin your chances of getting another response, so...  bump!

----------

## nein

Hi,

 I think I found the problem. As soon as I remove the  ${IFACE} parameter from the start-stop-daemon line in the start function in the init script it works fine. Because I make dhcp only listen to eth0, and eth0 is brought up after dhcp, the process does not complete successfully. Of course, after the boot process completes, eth0 is up and it works fine.

I have made some tests and the dhcp script fails if I bring net.eth0 down.

start() {

        checkconfig || return 1

        ebegin "Starting ${CHROOT:+chrooted }dhcpd"

        start-stop-daemon --start --quiet --exec /usr/sbin/dhcpd \

                -- -pf /var/run/dhcp/dhcpd.pid \

                -user dhcp -group dhcp ${DHCPD_OPTS} \

                ${CHROOT:+-chroot ${CHROOT}} ${IFACE}

        eend $?

}

----------

## katsiki

Can I ask which kernel you're running, and which DHCP server package?

----------

## nein

2.6.10-gentoo-r6 and the latest stable dhcp server (all the rest of the packages are also the latest stable version)

*  net-misc/dhcp

      Latest version available: 3.0.1-r1

      Latest version installed: 3.0.1-r1

----------

## katsiki

The changelog for dhcp-3.0.1-r1 lists fixing Bugzilla Bug 48207.  I can't tell if this is relevant.  Do you use more than one interface?  Do you have a dhcrelay init file?

----------

## nein

I am not using dhcrelay and I only use dhcp on one interface (eth0). I think the bug you pointed out is something different but I want to thank you for your interest.

I might be wrong, but, shouln't the dhcp daemon get started after all the net interfaces are up ? I does not (at least in my case) and that is what is causing the problem.

----------

## katsiki

Take a look at the section of the 2005.0 Handbook regarding init script dependencies and altering the order in which scripts are executed.  Maybe something got tweaked in the upgrade.

----------

## nein

Hi,

 I more or less know how the init process works and in fact the dhcpd service depends on the "net" service. The net service is started before dhcp, but only bringing the loopback interface up. What i do not know is how to make dhcpd depend also on the rest of the net interface.

Edit: Maybe setting  to RC_NET_STRICT_CHECKING to yes might help. I will try tomorrow and see what happens. Thanks, you suggestion did probably put me on the way to the solution

----------

## nein

Hi again,

 The RC_NET_STRICT_CHECKING did the trick. Now it works.

 Thanks you very much for your help

----------

## katsiki

You're welcome!  Thank you, too!  I learned a lot through your efforts.  I would not have figured this out without your help.

----------

## katsiki

BTW, can I ask which version of baselayout you are using?  Have you seen this thread?

----------

## nein

I have been using the latest stable version of the baselayout. Now I am using 1.11.13 but when I noticed the problem I was using the previous stable version (do not remember the version number).

Edit: I just had a look at the thread you pointed out and it seems a much more severe problem thant the one I had. In fact, it might be that my problem was not related to a bug rather than a misconfiguration. It was just that I did not remember the existance of the variable to control the net service checking. Maybe it would be good to change the default value of this variable but on the other side this might cause problems to other people.

----------

## katsiki

Looks like a developer chimed in since I had posted mention of that other thread.  UberLord says "Sorry", see Bugzilla Bug 99663 concerning baselayout-1.12.0_pre1-r1.

----------

## Swisside

 *nein wrote:*   

> Hi,
> 
>  I more or less know how the init process works and in fact the dhcpd service depends on the "net" service. The net service is started before dhcp, but only bringing the loopback interface up. What i do not know is how to make dhcpd depend also on the rest of the net interface.
> 
> Edit: Maybe setting  to RC_NET_STRICT_CHECKING to yes might help. I will try tomorrow and see what happens. Thanks, you suggestion did probably put me on the way to the solution

 

Hi nein, I have the same problem and wanted to try your resolution. But I missed where you changed RC_NET_STRICT_CHECKING to yes. Where do I have to edit that? Thanks for the help.

----------

## gemini91

/etc/conf.d/rc

----------

## Swisside

Excellent, thank you gemini91!

----------

