aboutsummaryrefslogtreecommitdiffstats
path: root/community/knot/knotd.initd
blob: 781346216ca4c08d0a78cb7537c2aad775739d5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/sbin/openrc-run
# 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 $

name="knotd"
command="/usr/sbin/knotd"
command_args="-d ${KNOTD_OPTS}"
start_stop_daemon_args="--wait 5"
required_files=/etc/knot/knot.conf
extra_started_commands="reload"
description_reload="Reload configuration and changed zones"

depend() {
	need net
}

start_pre() {
	checkpath -d -m 0750 -o knot:knot /run/knot/ /var/lib/knot/
}

stop() {
	ebegin "Stopping $name"
	/usr/sbin/knotc stop >/dev/null 2>&1
	# Mark service as stopped if remote control was successful
	if [ $? -eq 0 ]; then
		start-stop-daemon --stop --quiet --pidfile /run/knot/knot.pid
	fi
	eend $?
}

reload() {
	ebegin "Reloading $name"
	/usr/sbin/knotc reload >/dev/null
	eend $?
}