ipsec-tools: moved to github
[packages.git] / net / bind / files / named.init
1 #!/bin/sh /etc/rc.common
2 START=50
3
4 config_file=/etc/bind/named.conf
5 pid_file=/var/run/named/named.pid
6
7 start() {
8   if [ -e $pid_file ]
9   then
10      echo "  named already running with PID `cat $pid_file`"
11      return 1
12   fi
13   echo Starting isc-bind
14
15   /usr/sbin/named -c $config_file
16
17   if [ $? -ne 0 ]
18   then
19     echo "  isc-bind failed to start"
20   fi
21 }
22
23 stop() {
24   echo "Stopping isc-bind"
25   if [ -e $pid_file ]
26   then
27     kill `cat $pid_file`
28
29     if [ $? -ne 0 ]
30     then
31       echo "  PID " `cat $pid_file` not found
32       echo "  Is the named server running?"
33     fi
34
35     rm -f $pid_file
36
37     else
38     echo "  $pid_file not found"
39   fi
40 }