summaryrefslogtreecommitdiff
path: root/repo/unbound/unbound.initd
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-06-06 21:25:48 +0000
committerdavidovski <david@davidovski.xyz>2022-06-06 21:25:48 +0000
commitccc722b7ed330198d82a3cf28ead76d6d107a70a (patch)
tree7611b3cc4f3ca681524fa28b174a0253eb802e0e /repo/unbound/unbound.initd
parent9ee32689f0b57b9e1de6d22c84ce8e3700b6122b (diff)
added java
Diffstat (limited to 'repo/unbound/unbound.initd')
-rw-r--r--repo/unbound/unbound.initd48
1 files changed, 48 insertions, 0 deletions
diff --git a/repo/unbound/unbound.initd b/repo/unbound/unbound.initd
new file mode 100644
index 0000000..c5c6d70
--- /dev/null
+++ b/repo/unbound/unbound.initd
@@ -0,0 +1,48 @@
+#!/sbin/openrc-run
+
+extra_commands="checkconfig"
+extra_started_commands="reload"
+
+name="unbound daemon"
+description="unbound is a Domain Name Server (DNS) that is used to resolve host names to IP address."
+description_checkconfig="Run syntax tests for configuration files only."
+description_reload="Kills all children and reloads the configuration."
+
+# Upper case variables are here only for backward compatibility.
+: ${cfgfile:=${UNBOUND_CONFFILE:-/etc/unbound/$RC_SVCNAME.conf}}
+
+command=/usr/sbin/unbound
+command_args="-d $command_args"
+command_background=yes
+pidfile="/run/$RC_SVCNAME.pid"
+
+required_files="$cfgfile"
+
+depend() {
+ need net
+ use logger
+ provide dns
+ after auth-dns entropy
+}
+
+checkconfig() {
+ ebegin "Checking $cfgfile"
+ /usr/sbin/unbound-checkconf -f "$cfgfile" >/dev/null
+ eend $?
+}
+
+start_pre() {
+ checkconfig
+}
+
+reload() {
+ start_pre || return $?
+
+ ebegin "Reloading $name"
+ if [ "$supervisor" ]; then
+ $supervisor "$RC_SVCNAME" --signal HUP
+ else
+ start-stop-daemon --signal HUP --pidfile "$pidfile"
+ fi
+ eend $?
+}