2006-10-04 20:57:49 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
2007-05-10 10:38:53 +00:00
|
|
|
START=50
|
2006-11-06 13:54:52 +00:00
|
|
|
|
2007-05-07 16:27:44 +00:00
|
|
|
config_file=/etc/bind/named.conf
|
2010-07-15 22:42:48 +00:00
|
|
|
pid_file=/var/run/named/named.pid
|
2006-07-31 12:43:09 +00:00
|
|
|
|
2006-10-04 20:57:49 +00:00
|
|
|
start() {
|
2010-03-23 01:43:31 +00:00
|
|
|
if [ -e $pid_file ]
|
|
|
|
then
|
|
|
|
echo " named already running with PID `cat $pid_file`"
|
|
|
|
return 1
|
|
|
|
fi
|
2007-05-07 16:27:44 +00:00
|
|
|
echo Starting isc-bind
|
2006-11-06 13:54:52 +00:00
|
|
|
|
2007-05-07 16:27:44 +00:00
|
|
|
/usr/sbin/named -c $config_file
|
2006-11-06 13:54:52 +00:00
|
|
|
|
2009-04-12 14:53:08 +00:00
|
|
|
if [ $? -ne 0 ]
|
2006-11-06 13:54:52 +00:00
|
|
|
then
|
2007-05-07 16:27:44 +00:00
|
|
|
echo " isc-bind failed to start"
|
2006-11-06 13:54:52 +00:00
|
|
|
fi
|
2006-10-04 20:57:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2007-05-07 16:27:44 +00:00
|
|
|
echo "Stopping isc-bind"
|
2006-11-06 13:54:52 +00:00
|
|
|
if [ -e $pid_file ]
|
|
|
|
then
|
|
|
|
kill `cat $pid_file`
|
|
|
|
|
2010-03-23 01:43:31 +00:00
|
|
|
if [ $? -ne 0 ]
|
2006-11-06 13:54:52 +00:00
|
|
|
then
|
|
|
|
echo " PID " `cat $pid_file` not found
|
2007-05-07 16:27:44 +00:00
|
|
|
echo " Is the named server running?"
|
2006-11-06 13:54:52 +00:00
|
|
|
fi
|
|
|
|
|
2010-03-23 01:43:31 +00:00
|
|
|
rm -f $pid_file
|
2006-11-06 13:54:52 +00:00
|
|
|
|
|
|
|
else
|
|
|
|
echo " $pid_file not found"
|
|
|
|
fi
|
2006-10-04 20:57:49 +00:00
|
|
|
}
|