Modify

Opened 9 years ago

Closed 9 years ago

#4692 closed defect (worksforme)

dhcpd init script doesn't kill dhcpd when restarting or stopping

Reported by: exobyte Owned by: florian
Priority: low Milestone: Kamikaze 8.09.1
Component: packages Version:
Keywords: Cc:

Description

For some reason, kill needs to sent a hangup.

This script seems to work:

#!/bin/sh /etc/rc.common
START=60

lease_file=/tmp/dhcpd.leases
config_file=/etc/dhcpd.conf
pid_file=/var/run/dhcpd.pid

start() {
        echo Starting isc-dhcpd

        if [ ! -e $lease_file ]; then
                echo "  Creating $lease_file"
                touch $lease_file
        fi

        /usr/sbin/dhcpd -q -cf $config_file -lf $lease_file -pf $pid_file

        if [ $? -ne 0 ]; then
                echo "  isc-dhcpd failed to start"
        fi
}

stop() {
        echo "Stopping isc-dhcpd"
        if [ -e $pid_file ]; then
                kill -HUP `cat $pid_file`

                if [ $? -ne 0 ]; then
                        echo "  PID " `cat $pid_file` not found
                        echo "  Is the DHCP server running?"
                else
                        echo "  DHCP server stopped"
                fi

                rm $pid_file
        else
                echo "  $pid_file not found"
        fi
}


Attachments (0)

Change History (2)

comment:1 Changed 9 years ago by florian

  • Milestone set to Kamikaze 8.09.1
  • Owner changed from developers to florian
  • Priority changed from normal to low
  • Status changed from new to assigned

comment:2 Changed 9 years ago by florian

  • Resolution set to worksforme
  • Status changed from assigned to closed

No it does not need this:

/etc/init.d/dhcpd start
Apr 23 13:08:38 OpenWrt daemon.info dnsmasq[2314]: exiting on receipt of SIGTERM
Apr 23 13:08:41 OpenWrt local7.info dhcpd: Internet Systems Consortium DHCP Server V3.1.0
Apr 23 13:08:41 OpenWrt local7.info dhcpd: Copyright 2004-2007 Internet Systems Consortium.
Apr 23 13:08:41 OpenWrt local7.info dhcpd: All rights reserved.
Apr 23 13:08:41 OpenWrt local7.info dhcpd: For info, please visit http://www.isc.org/sw/dhcp/
Apr 23 13:08:41 OpenWrt local7.info dhcpd: Wrote 0 leases to leases file.
/etc/init.d/dhcpd restart
Apr 23 13:09:07 OpenWrt local7.info dhcpd: Internet Systems Consortium DHCP Server V3.1.0
Apr 23 13:09:07 OpenWrt local7.info dhcpd: Copyright 2004-2007 Internet Systems Consortium.
Apr 23 13:09:07 OpenWrt local7.info dhcpd: All rights reserved.
Apr 23 13:09:07 OpenWrt local7.info dhcpd: For info, please visit http://www.isc.org/sw/dhcp/
Apr 23 13:09:07 OpenWrt local7.info dhcpd: Wrote 0 leases to leases file.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.