linuxconf Howto/FAQ

Howto index

Starting the DHCP service

On distributions using system V start-up scripts, Linuxconf relies on those scripts to start, stop and restart services. One exception is the dhcpd server. If the service is not already running, Linuxconf will start it "by hand". In some cases, the simple start-up script supplied by RedHat will fail to start the dhcpd service properly. The simple case works: One network interface with the default route pointing to it. If you have several interfaces and you wish to serve DHCP on the interfaces not pointing to the default gateway, dhcpd won't start, or it will start, but won't serve properly. In this case, you must tell explicitly to the dhcpd server which network to serve and you must add special routes to let the DHCP replies goes out.

Computing the proper dhcpd arguments and setting, if needed, the special route is a little beyond the abilities of a start-up script. So we wrote a helper system in Linuxconf dhcpd module, allowing the script to act properly. Unfortunately, no distribution ships this solution. So for now we have elected to let Linuxconf starts the dhcpd daemon itself if it is not already running. So for simple cases, Linuxconf has nothing to do. For complex case, where the script failed (silently I must add), Linuxconf tries to help.

This has one side effect. If you want to disable the dhcpd service, just turning off the system V dhcp service is not enough. Seeing that dhcpd is not running, Linuxconf will try to "fix this". So if you want to turn off the dhcpd service completely, you have two options:

A replacement for the RedHat 7.0 dhcpd startup script is available here

The change is in the start() section and look like this

start() {
        # Start daemons.
        # Unless you have a basic network setup (one interface, default
        # route pointing to it), just starting dhcpd won't work.
        # We use linuxconf to learn on which network the dhcpd server
        # must run and which special routes must be added
        if [ -x /sbin/linuxconf ] ; then
                eval `/sbin/linuxconf --hint dhcpd 2>/dev/null`
                if [ "$DEVICES" != "" ] ; then
                        for dev in $DEVICES
                                ROUTE=`echo $ROUTES | ( read a rest; echo $a)`
                                ROUTES=`echo $ROUTES | ( read a rest; echo $rest)`
                                if [ "$ROUTE" = "missing" ] ; then
                                        /sbin/route add -host dev $dev
        echo -n "Starting dhcpd: "
        daemon /usr/sbin/dhcpd $DEVICES
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcpd
        return $RETVAL