summaryrefslogtreecommitdiffstats
path: root/debian/knot-resolver.kresd.init
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 00:55:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 00:55:53 +0000
commit129b974b59c74140570847bb4a2774d41d1e5fae (patch)
treef2dc68e7186b8157e33aebbc2526e016912ded82 /debian/knot-resolver.kresd.init
parentAdding upstream version 3.2.1. (diff)
downloadknot-resolver-debian.tar.xz
knot-resolver-debian.zip
Adding debian version 3.2.1-3.debian/3.2.1-3debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--debian/knot-resolver.kresd.init59
1 files changed, 59 insertions, 0 deletions
diff --git a/debian/knot-resolver.kresd.init b/debian/knot-resolver.kresd.init
new file mode 100644
index 0000000..47331ed
--- /dev/null
+++ b/debian/knot-resolver.kresd.init
@@ -0,0 +1,59 @@
+#!/bin/sh
+# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
+if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
+ if [ -x /lib/init/init-d-script ]; then
+ set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
+ else
+ set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /usr/lib/knot-resolver/init-d-script
+ fi
+fi
+### BEGIN INIT INFO
+# Provides: kresd
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Knot DNS Resolver
+# Description: Knot DNS Resolver
+### END INIT INFO
+
+# Author: Ondřej Surý <ondrej@debian.org>
+
+NAME=kresd
+DESC="Knot DNS Resolver"
+DAEMON=/usr/sbin/kresd
+START_ARGS="--background --make-pidfile"
+
+do_tmpfiles() {
+ local tmpfile type path mode user group age argument
+ tmpfile=/usr/lib/tmpfiles.d/$1.conf
+ if [ -r "$tmpfile" ]; then
+ if [ -x /bin/systemd-tmpfiles ]; then
+ /bin/systemd-tmpfiles --create "$tmpfile"
+ else
+ while read type path mode user group age argument; do
+ case "$type" in
+ d)
+ mkdir -p "$path";
+ chmod "$mode" "$path";
+ chown "$user:$group" "$path";
+ ;;
+ L)
+ if [ ! -e "$path" ]; then ln -s "$argument" "$path"; fi
+ ;;
+ \#*)
+ ;;
+ *)
+ log_warning_msg "tmpfile.d type '$type' is not supported yet"
+ ;;
+ esac
+ done < "$tmpfile"
+ fi
+ else
+ log_warning_msg "tmpfiles.d file '$1' doesn't exist or is not readable"
+ fi
+}
+
+do_start_prepare() {
+ do_tmpfiles knot-resolver
+}