wok annotate bind/stuff/etc/init.d/named @ rev 12095
nanochess, sudoku: run tazweb --notoolbar (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Mar 10 23:13:38 2012 +0100 (2012-03-10) |
parents | 43ae0b5f0a8a |
children | 7f188676b59c |
rev | line source |
---|---|
pascal@1612 | 1 #!/bin/sh |
pascal@1612 | 2 # /etc/init.d/named: Start, stop and restart Named deamon on SliTaz, at boot |
pascal@1612 | 3 # time or with the command line. |
pascal@1612 | 4 # |
pascal@1612 | 5 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS |
pascal@1612 | 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf. |
pascal@1612 | 7 # |
pascal@1612 | 8 . /etc/init.d/rc.functions |
pascal@1612 | 9 . /etc/daemons.conf |
pascal@1612 | 10 |
pascal@1612 | 11 NAME=Named |
pascal@1612 | 12 DESC="Named deamon" |
pascal@1612 | 13 DAEMON=/usr/sbin/named |
pascal@1612 | 14 OPTIONS=$NAMED_OPTIONS |
pascal@1612 | 15 PIDFILE=/var/run/named.pid |
pascal@1612 | 16 #[ -n "$OPTIONS" ] || OPTIONS="-u nobody" |
pascal@1612 | 17 [ -f /etc/bind/rndc.key ] || rndc-confgen -r /dev/urandom -a |
pascal@1612 | 18 |
pascal@1612 | 19 case "$1" in |
pascal@1612 | 20 start) |
pascal@2286 | 21 if active_pidfile $PIDFILE named ; then |
pascal@1612 | 22 echo "$NAME already running." |
pascal@1612 | 23 exit 1 |
pascal@1612 | 24 fi |
pascal@1612 | 25 echo -n "Starting $DESC: $NAME... " |
pascal@1612 | 26 $DAEMON $OPTIONS |
pascal@1612 | 27 status |
pascal@1612 | 28 ;; |
pascal@1612 | 29 stop) |
pascal@2286 | 30 if ! active_pidfile $PIDFILE named ; then |
pascal@1612 | 31 echo "$NAME is not running." |
pascal@1612 | 32 exit 1 |
pascal@1612 | 33 fi |
pascal@1612 | 34 echo -n "Stopping $DESC: $NAME... " |
pascal@1612 | 35 /usr/sbin/rndc stop |
pascal@1612 | 36 status |
pascal@1612 | 37 ;; |
pascal@1612 | 38 reload) |
pascal@1612 | 39 /usr/sbin/rndc reload |
pascal@1612 | 40 status |
pascal@1612 | 41 ;; |
pascal@1612 | 42 restart) |
pascal@2286 | 43 if ! active_pidfile $PIDFILE named ; then |
pascal@1612 | 44 echo "$NAME is not running." |
pascal@1612 | 45 exit 1 |
pascal@1612 | 46 fi |
pascal@1612 | 47 echo -n "Restarting $DESC: $NAME... " |
pascal@1612 | 48 /usr/sbin/rndc stop |
pascal@1612 | 49 sleep 2 |
pascal@1612 | 50 $DAEMON $OPTIONS |
pascal@1612 | 51 status |
pascal@1612 | 52 ;; |
pascal@1612 | 53 *) |
pascal@1612 | 54 echo "" |
pascal@1612 | 55 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|reload|restart]" |
pascal@1612 | 56 echo "" |
pascal@1612 | 57 exit 1 |
pascal@1612 | 58 ;; |
pascal@1612 | 59 esac |
pascal@1612 | 60 |
pascal@1612 | 61 exit 0 |