File: init.d

package info (click to toggle)
bind 1%3A8.4.6-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 19,752 kB
  • ctags: 22,385
  • sloc: ansic: 159,091; sh: 19,593; perl: 14,224; makefile: 5,554; yacc: 2,475; cpp: 2,154; csh: 848; awk: 753; tcl: 674; lex: 423; fortran: 240
file content (58 lines) | stat: -rw-r--r-- 1,063 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh

# Defaults - don't touch, edit /etc/default/bind
OPTIONS=""

test -f /etc/default/bind && . /etc/default/bind

PATH=/sbin:/bin:/usr/sbin:/usr/bin

test -x /usr/sbin/ndc || exit 0

start () {
	echo -n "Starting domain name service: named"
	if [ ! -x /usr/sbin/named ]; then
	    echo "named binary missing - not starting"
	    exit 1
	fi
	start-stop-daemon --start --quiet \
	    --pidfile /var/run/named.pid --exec /usr/sbin/named  -- $OPTIONS
	echo "."	
}

stop () {
	echo -n "Stopping domain name service: named"
	# --exec doesn't catch daemons running deleted instances of named,
	# as in an upgrade.  Fortunately, --pidfile is only going to hit
	# things from the pidfile.
	start-stop-daemon --stop --quiet  \
	    --pidfile /var/run/named.pid --name named
	echo "."	
}

case "$1" in
    start)
	start
    ;;

    stop)
	stop
    ;;

    restart|force-reload)
	stop
	sleep 2
	start
    ;;
    
    reload)
	/usr/sbin/ndc reload
    ;;

    *)
	echo "Usage: /etc/init.d/bind {start|stop|reload|restart|force-reload}" >&2
	exit 1
    ;;
esac

exit 0