diff options
author | peter <peter@FreeBSD.org> | 1995-08-20 21:32:49 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1995-08-20 21:32:49 +0000 |
commit | 3b894f576160a2aecb7b14e0329113ed5f96b31a (patch) | |
tree | 50a7e27244c305fd66cac4ce14dd6c55dedaf8d9 /usr.sbin | |
parent | b2b86220d1030bbcbfa90be0d22674d9021cc5d7 (diff) | |
download | FreeBSD-src-3b894f576160a2aecb7b14e0329113ed5f96b31a.zip FreeBSD-src-3b894f576160a2aecb7b14e0329113ed5f96b31a.tar.gz |
Update 4.9.3.beta9p1 -> 4.9.3-beta24
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/named/tools/named.reload/named.reload.sh | 5 | ||||
-rw-r--r-- | usr.sbin/named/tools/named.restart/named.restart.sh | 9 | ||||
-rw-r--r-- | usr.sbin/named/tools/ndc/ndc.sh | 72 |
3 files changed, 77 insertions, 9 deletions
diff --git a/usr.sbin/named/tools/named.reload/named.reload.sh b/usr.sbin/named/tools/named.reload/named.reload.sh index a25de1b..0b6495a 100644 --- a/usr.sbin/named/tools/named.reload/named.reload.sh +++ b/usr.sbin/named/tools/named.reload/named.reload.sh @@ -1,6 +1,7 @@ #!/bin/sh - # # from named.reload 5.2 (Berkeley) 6/27/89 -# $Id: named.reload.sh,v 4.9.1.2 1993/09/08 00:01:17 vixie Exp $ +# $Id: named.reload.sh,v 8.1 1994/12/15 06:24:14 vixie Exp $ # -kill -HUP `cat %PIDDIR%/named.pid` + +exec %DESTSBIN%/%INDOT%ndc reload diff --git a/usr.sbin/named/tools/named.restart/named.restart.sh b/usr.sbin/named/tools/named.restart/named.restart.sh index 8a61ccca..4d073e6 100644 --- a/usr.sbin/named/tools/named.restart/named.restart.sh +++ b/usr.sbin/named/tools/named.restart/named.restart.sh @@ -1,12 +1,7 @@ #!/bin/sh - # # from named.restart 5.4 (Berkeley) 6/27/89 -# $Id: named.restart.sh,v 4.9.1.5 1994/04/09 03:43:17 vixie Exp $ +# $Id: named.restart.sh,v 8.1 1994/12/15 06:24:14 vixie Exp $ # -PATH=%DESTSBIN%:/bin:/usr/bin - -pid=`cat %PIDDIR%/named.pid` -kill $pid -sleep 5 -exec %INDOT%named +exec %DESTSBIN%/%INDOT%ndc restart diff --git a/usr.sbin/named/tools/ndc/ndc.sh b/usr.sbin/named/tools/ndc/ndc.sh new file mode 100644 index 0000000..a9a0557 --- /dev/null +++ b/usr.sbin/named/tools/ndc/ndc.sh @@ -0,0 +1,72 @@ +#!/bin/sh + +USAGE='echo \ + "usage: $0 \ + (status|dumpdb|reload|stats|trace|notrace|querylog|start|stop|restart) \ + ... \ + "; exit 1' + +PATH=%DESTSBIN%:/bin:/usr/bin:/usr/ucb:$PATH +PIDFILE=%PIDDIR%/named.pid + +[ -f $PIDFILE ] || { + echo "$0: $PIDFILE does not exist" + exit 1 +} +PID=`cat $PIDFILE` +PS=`%PS% $PID | tail -1 | grep $PID` +RUNNING=1 +[ `echo $PS | wc -w` -ne 0 ] || { + PS="named (pid $PID?) not running" + RUNNING=0 +} + +for ARG +do + case $ARG in + start|stop|restart) + ;; + *) + [ $RUNNING -eq 0 ] && { + echo $PS + exit 1 + } + esac + + case $ARG in + status) echo "$PS";; + dumpdb) kill -INT $PID && echo Dumping Database;; + reload) kill -HUP $PID && echo Reloading Database;; + stats) kill -%IOT% $PID && echo Dumping Statistics;; + trace) kill -USR1 $PID && echo Trace Level Incremented;; + notrace) kill -USR2 $PID && echo Tracing Cleared;; + querylog|qrylog) kill -WINCH $PID && echo Query Logging Toggled;; + start) + [ $RUNNING -eq 1 ] && { + echo "$0: start: named (pid $PID) already running" + continue + } + %INDOT%named && echo Name Server Started + ;; + stop) + [ $RUNNING -eq 0 ] && { + echo "$0: stop: named not running" + continue + } + kill $PID && { + sleep 5 + echo Name Server Stopped + } + ;; + restart) + [ $RUNNING -eq 1 ] && { + kill $PID && sleep 5 + } + %INDOT%named && echo Name Server Restarted + ;; + *) eval "$USAGE";; + esac +done +test -z "$ARG" && eval "$USAGE" + +exit 0 |