Modify

Opened 11 years ago

Closed 10 years ago

#924 closed enhancement (fixed)

isc-dhcpd init script

Reported by: exobyte Owned by: developers
Priority: normal Milestone:
Component: packages Version:
Keywords: Cc:

Description

It's a little more complex than the normal init scripts, but so is the isc dhcp server. I'm posting it because I didn't find an init script with the most recent build. It's been based on a few different scripts, I think. GPL it, BSD it, whatever, but I'm making it public domain, so anyone can do anything with it.

#!/bin/sh /etc/rc.common

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 -cf $config_file -lf $lease_file

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

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

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

    rm $pid_file

    else
    echo "  $pid_file not found"
  fi
}

Attachments (0)

Change History (3)

comment:1 Changed 11 years ago by florian

  • Resolution set to fixed
  • Status changed from new to closed

Added in [5449], thanks !

comment:2 Changed 10 years ago by nicolas.pichon@…

  • Resolution fixed deleted
  • Status changed from closed to reopened

As I can see in [5449] and #1627, init script has been added to bind-server package instead of isc-dhcpd. Current SVN still hasn't an init script for isc-dhcpd.

The one provided in this report seems to be OK and should be added IMHO.

Regards.

comment:3 Changed 10 years ago by florian

  • Resolution set to fixed
  • Status changed from reopened to closed

Fixed with [9241], thanks !

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.