aboutsummaryrefslogtreecommitdiffstats
path: root/community/kea/kea.initd.in
blob: 7d2b39617abeb23993fcf1878cd6937980a025d5 (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
#!/sbin/openrc-run

: ${cfgfile:="/etc/kea/@@NAME@@.conf"}
: ${command_user:="kea"}
: ${wait:=100}

name="@@NAME@@"
extra_commands="checkconfig"
description_checkconfig="Checks configuration file for errors"

command="/usr/sbin/@@NAME@@"
command_args="-c $cfgfile"
command_background="yes"
pidfile="/run/$RC_SVCNAME.pid"
start_stop_daemon_args="--wait $wait $start_stop_daemon_args"

depend() {
	need net
	after firewall
}

start_pre() {
	checkpath -d -m 0750 -o $command_user /run/kea /run/kea/lock

	checkconfig
}

checkconfig() {
	ebegin "Checking $name configuration"
	$command -t "$cfgfile" >/dev/null
	eend $?
}