~ubuntu-branches/ubuntu/gutsy/dhcp/gutsy-security

« back to all changes in this revision

Viewing changes to debian/dhcp.init.d

  • Committer: Bazaar Package Importer
  • Author(s): Eloy A. Paris
  • Date: 2004-05-26 12:00:58 UTC
  • Revision ID: james.westby@ubuntu.com-20040526120058-w2v4k2cstzp3qvfb
Tags: 2.0pl5-19
Use invoke-rc.d if available when starting the DHCP server.
(Closes: #250878)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# $Id: dhcp.init.d,v 1.3.2.2 2002/08/11 22:11:54 peloy Exp $
 
4
#
 
5
 
 
6
test -x /usr/sbin/dhcpd || exit 0
 
7
 
 
8
# Defaults
 
9
INTERFACES="eth0"
 
10
 
 
11
# Reads config file (will override defaults above)
 
12
[ -r /etc/default/dhcp ] && . /etc/default/dhcp
 
13
 
 
14
DHCPDPID=/var/run/dhcpd.pid
 
15
 
 
16
case "$1" in
 
17
        start)
 
18
                echo -n "Starting DHCP server: "
 
19
                start-stop-daemon --start --quiet --pidfile $DHCPDPID \
 
20
                        --exec /usr/sbin/dhcpd -- -q $INTERFACES
 
21
                sleep 2
 
22
 
 
23
                if [ -f "$DHCPDPID" ] && ps h `cat "$DHCPDPID"` >/dev/null; then
 
24
                        echo "dhcpd."
 
25
                else
 
26
                        echo "dhcpd failed to start - check syslog for diagnostics."
 
27
                fi
 
28
                ;;
 
29
        stop)
 
30
                echo -n "Stopping DHCP server: dhcp"
 
31
                start-stop-daemon --stop --quiet --pidfile $DHCPDPID
 
32
                echo "."
 
33
                ;;
 
34
        restart | force-reload)
 
35
                $0 stop
 
36
                sleep 2
 
37
                $0 start
 
38
                ;;
 
39
        *)
 
40
                echo "Usage: /etc/init.d/dhcp {start|stop|restart|force-reload}"
 
41
                exit 1 
 
42
esac
 
43
 
 
44
exit 0