File: ndc.debian

package info (click to toggle)
bind 1%3A8.1.2-3
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 5,072 kB
  • ctags: 7,956
  • sloc: ansic: 54,480; sh: 6,937; makefile: 2,900; yacc: 1,223; perl: 315; lex: 221; awk: 45; sed: 15
file content (80 lines) | stat: -rw-r--r-- 1,745 bytes parent folder | download | duplicates (2)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/sh

USAGE='echo \
	"usage: $0 \
 (status|dumpdb|reload|stats|trace|notrace|querylog|start|stop|restart) \
	 ... \
	"; exit 1'

PATH=/usr/sbin:/bin:/usr/bin:/usr/ucb:$PATH
PIDFILE=/var/run/named.pid

for ARG
do
	case $ARG in
	status)	
		if [ -f $PIDFILE ]
		then
			PID=`cat $PIDFILE`
			PS=`ps $PID | tail -1 | grep $PID`
			[ `echo $PS | wc -w` -ne 0 ] || {
				PS="named (pid $PID?) not running"
			}
		else
			PS="named (no pid file) not running"
		fi

		echo "$PS"
		;;
	dumpdb)	
		start-stop-daemon --stop --signal 2 --pidfile $PIDFILE &&
		  echo Dumping Database
                echo ssd $?
		;;
	reload)	
		start-stop-daemon --stop --signal 1 --pidfile $PIDFILE &&
		  echo Reloading Database
		;;
	stats)	
		start-stop-daemon --stop --signal 6 --pidfile $PIDFILE &&
		  echo Dumping Statistics
		;;
	trace)	
		#kill -USR1 $PID && echo Trace Level Incremented
		start-stop-daemon --stop --signal 10 --pidfile $PIDFILE &&
		  echo Trace Level Incremented
		;;
	notrace) 
		start-stop-daemon --stop --signal 12 --pidfile $PIDFILE &&
		  echo Tracing Cleared
		;;
	querylog|qrylog) 
		#kill -WINCH $PID && echo Query Logging Toggled
		start-stop-daemon --stop --signal 28 --pidfile $PIDFILE &&
		  echo Query Logging Toggled
		;;
	start)
		echo -n "Starting Domain Name Service : named"
		start-stop-daemon --start --quiet --exec /usr/sbin/named
		echo "."

		;;
	stop)
		echo -n "Stoping Domain Name Service : named"
		start-stop-daemon --stop --pidfile $PIDFILE
		echo "."
		;;
	restart)
		start-stop-daemon --stop --quiet --pidfile $PIDFILE
		sleep 5
		start-stop-daemon --start --exec /usr/sbin/named && {
		  sleep 5
		  echo Name Server Restarted
		}
		;;
	*)	eval "$USAGE";;
	esac
done
test -z "$ARG" && eval "$USAGE"

exit 0