From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- net-dns/knot/files/knot.init | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 net-dns/knot/files/knot.init (limited to 'net-dns/knot/files/knot.init') diff --git a/net-dns/knot/files/knot.init b/net-dns/knot/files/knot.init new file mode 100644 index 000000000000..8dc460c31cd4 --- /dev/null +++ b/net-dns/knot/files/knot.init @@ -0,0 +1,41 @@ +#!/sbin/openrc-run +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +command=/usr/sbin/knotd +command_args="-d" +pidfile=/var/run/knot/knot.pid +required_files=/etc/knot/knot.conf +extra_started_commands="reload" +description_reload="Reload configuration and changed zones." + +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 $? +} -- cgit v1.2.3