diff options
Diffstat (limited to 'network/nsd/rc.nsd')
-rw-r--r-- | network/nsd/rc.nsd | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/network/nsd/rc.nsd b/network/nsd/rc.nsd new file mode 100644 index 0000000000000..55118d9464cff --- /dev/null +++ b/network/nsd/rc.nsd @@ -0,0 +1,50 @@ +#!/bin/sh +# +# Start/stop/restart nsd +# + +do_start() { + if [ -x /usr/sbin/nsd ]; then + echo "Starting Name Server Daemon: /usr/sbin/nsd" + /usr/sbin/nsd -c /etc/nsd/nsd.conf 2> /dev/null + fi +} + +do_stop() { + echo "Stopping Name Server Daemon" + kill $(cat /var/run/nsd/nsd.pid) 2> /dev/null +} + +do_restart() { + do_stop + sleep 1 + do_start +} + +do_reload() { + kill -HUP $(cat /var/run/nsd/nsd.pid) +} + +do_logreopen() { + do_reload +} + +case "$1" in +'start') + do_start + ;; +'stop') + do_stop + ;; +'restart') + do_restart + ;; +'reload') + do_reload + ;; +'logreopen') + do_logreopen + ;; +*) + echo "usage $0 start|stop|restart|reload|logreopen" +esac |