diff options
Diffstat (limited to 'testing/knot/knot.initd')
-rw-r--r-- | testing/knot/knot.initd | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/testing/knot/knot.initd b/testing/knot/knot.initd new file mode 100644 index 0000000000..1de82d9d6d --- /dev/null +++ b/testing/knot/knot.initd @@ -0,0 +1,35 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/knot/files/knot.init,v 1.2 2013/08/21 09:23:59 scarabeus Exp $ + +depend() { + need net +} + +start() { + checkpath -d -m 0750 -o knot:knot /var/run/knot/ /var/lib/knot/ + + ebegin "Starting knot" + start-stop-daemon --start \ + --pidfile $pidfile --exec $command -- $command_args + eend $? +} + +stop() { + ebegin "Stoping knot" + /usr/sbin/knotc stop >/dev/null 2>&1 + # In case remote control is not working + if [ "$?" != 0 ]; then + if [ -f $pidfile ]; then + start-stop-daemon --stop --pidfile $pidfile + fi + fi + ewend $? +} + +reload() { + ebegin "Reloading knot" + /usr/sbin/knotc reload >/dev/null + eend $? +} |