Hi Falko,
It's executable for root:
-rwx------ 1 root root 2122 Jul 23 14:20 dnsctl
The my DNS init script looks like:
[root@ns1 init.d]# cat mydns
#!/bin/bash
#
# mydns This starts and stops mydns.
#
# chkconfig: 345 52 50
# description: A database-driven DNS server
#
# processname: /usr/sbin/mydns
# config: /etc/mydns.conf
# pidfile: /var/run/mydns.pid
PATH=/sbin:/bin:/usr/bin:/usr/sbin
prog=mydns
# Source function library.
. /etc/init.d/functions
[ -f /usr/sbin/mydns ] || exit 1
[ -f /etc/mydns.conf ] || exit 1
RETVAL=0
start(){
echo -n $"Starting $prog: "
daemon $prog -b
RETVAL=$?
echo
touch /var/lock/subsys/mydns
return $RETVAL
}
stop(){
echo -n $"Stopping $prog: "
killproc $prog
RETVAL=$?
echo
rm -f /var/lock/subsys/mydns
return $RETVAL
}
restart(){
stop
start
}
condrestart(){
[ -e /var/lock/subsys/mydns ] && restart
return 0
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $prog
;;
restart|reload)
restart
;;
condrestart)
condrestart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
RETVAL=1
esac
exit $RETVAL
And the contents of dnsctl look like:
[root@ns1 sbin]# cat dnsctl
#!/bin/sh
# Don Walters
#
don@servershak.com
#
# chkconfig:
# description: the djbdns DNS
PATH=/bin:/usr/bin:/usr/local/bin:/usr/local/sbin
export PATH
case "$1" in
start)
echo "Starting dns"
if svok /service/dnscache ; then
svc -u /service/dnscache
else
echo dnscache service not running
fi
if svok /service/tinydns ; then
svc -u /service/tinydns
else
echo tinydns service not running
fi
if [ -d /var/lock/subsys ]; then
touch /var/lock/subsys/dns
fi
;;
stop)
echo "Stopping dns ..."
echo " dnscache"
svc -d /service/dnscache
echo " tinydns"
svc -d /service/tinydns
if [ -f /var/lock/subsys/dns ]; then
rm /var/lock/subsys/dns
fi
;;
stat)
svstat /service/dnscache
svstat /service/dnscache/log
echo "--"
svstat /service/tinydns
svstat /service/tinydns/log
;;
reload|hup)
echo "Sending HUP signal to dns."
svc -h /service/dnscache
svc -h /service/tinydns
;;
pause)
echo "Pausing dnscache"
svc -p /service/dnscache
echo "Pausing tinydns"
svc -p /service/tinydns
;;
cont)
echo "Continuing dnscache"
svc -c /service/dnscache
echo "Continuing tinydns"
svc -c /service/tinydns
;;
restart)
echo "Restarting dns:"
echo "* Stopping dnscache."
svc -d /service/dnscache
echo "* Stopping tinydns."
svc -d /service/tinydns
echo "* Restarting dnscache."
svc -u /service/dnscache
echo "* Restarting tinydns."
svc -u /service/tinydns
;;
help)
cat <<HELP
start -- starts dns service (dns connections allowed. queries can go out)
stop -- stops dns service (dns connections refused, nothing goes out)
pause -- temporarily stops dns service (dns connections accepted, nothing leaves)
cont -- continues paused dns service
stat -- displays status of mail service
restart -- stops and restarts dns
reload -- sends dns HUP
hup -- same as reload
HELP
;;
*)
echo "Usage: $0 {start|stop|restart|reload|stat|pause|cont|help}"
exit 1
;;
esac
exit 0
[root@ns1 sbin]#
Cheers,
Hurf
Recent comments
11 hours 29 min ago
11 hours 34 min ago
16 hours 32 min ago
23 hours 13 min ago
1 day 2 min ago
1 day 1 hour ago
1 day 5 hours ago
1 day 12 hours ago
1 day 16 hours ago
1 day 17 hours ago