aboutsummaryrefslogtreecommitdiffstats
path: root/community/kea/kea.initd.in
diff options
context:
space:
mode:
Diffstat (limited to 'community/kea/kea.initd.in')
-rw-r--r--community/kea/kea.initd.in32
1 files changed, 32 insertions, 0 deletions
diff --git a/community/kea/kea.initd.in b/community/kea/kea.initd.in
new file mode 100644
index 0000000000..7d2b39617a
--- /dev/null
+++ b/community/kea/kea.initd.in
@@ -0,0 +1,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 $?
+}