Shutting down and restarting the dhcp server via omapi

Jürgen Dietl juergen.dietl at googlemail.com
Thu Feb 24 13:56:36 UTC 2011


Hello,

i went through a lot of all posts from 2006,2007 and so on and all people
says there is no clean way to stop and start the ISC DHCP Server via Omapi.
Now 4 years later I hope there will be a solution.

I use the follwoing script:

---------------- truncated ----------------------

case "$1" in
    'start')
        echo  "Starting DHCP server $INTERFACEIP "
        echo ""
        $DAEMON_BIN $INTERFACE  -lf $LEASE_FILE -cf $CONFIG_FILE
        ;;

    'stop')
        echo  "Stopping DHCP server $INTERFACEIP "
        echo ""
        #Kill and restart dhcpd.
        # if test -s /var/run/dhcpd.pid; then
        #What's the current dhcpd process number?
        # DHCPPROC=`cat /var/run/dhcpd.pid`
        #Save that for later.
        #Send the omapi commands to kill dhcpd.

        #kill `cat $DAEMON_PIDFILE`
        $OMAPI_STOP_BIN $INTERFACEIP
        #Start looping and testing for the absence of the PID.
        #while ps -p $DHCPPROC >/dev/null; do
        #sleep .5
        #done
        #fi
        #Always do this.
        #/usr/local/sbin/dhcpd -q
        #dhcpd should now be running
        # rm $DAEMON_PIDFILE
        ;;

------ truncated --------------

the "#" lines I got from a post here in the mail history but also made no
change.

My main problem is that when I stop the dhcp server I always will get a
"communication-interrupted". What I would like to have is a "partner-down".

So do any of you have a script or an idea how I can make the server to make
a graceful shutdown of dhcp service?

thanx a lot,
cheers,
Juergen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20110224/bfe89128/attachment.html>


More information about the dhcp-users mailing list