summaryrefslogtreecommitdiff
path: root/frontends/etc/rc.d
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-16 15:22:00 +0300
committerPaul Buetow <paul@buetow.org>2026-05-16 15:22:00 +0300
commit91d5fec541ecc9147d89a2c25f3ba76ce1895bb7 (patch)
tree848c677cb4b3748dc2d104f30f4d77ab068fc894 /frontends/etc/rc.d
parent98217b5ab29265d2662bebf0a1d946eaead80dbd (diff)
frontends + packages: add dserver/dtail support for FreeBSD and Rocky
Adds FreeBSD .tpl variants of the existing dserver templates and a matching pkg-dtail-freebsd.sh packaging script, plus a pkg-dtail-rpm.sh script and packages/files/dtail-rocky/ (systemd units, key-cache script, dtail.json) for the Rocky Linux dtail build.
Diffstat (limited to 'frontends/etc/rc.d')
-rw-r--r--frontends/etc/rc.d/dserver-freebsd.tpl30
1 files changed, 30 insertions, 0 deletions
diff --git a/frontends/etc/rc.d/dserver-freebsd.tpl b/frontends/etc/rc.d/dserver-freebsd.tpl
new file mode 100644
index 0000000..6110c0c
--- /dev/null
+++ b/frontends/etc/rc.d/dserver-freebsd.tpl
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# PROVIDE: dserver
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+. /etc/rc.subr
+
+name="dserver"
+rcvar="dserver_enable"
+desc="DTail distributed log server"
+
+# Use daemon(8) explicitly: rc.subr's dserver_user wraps with su -m but does
+# not fork, so the service command blocks. daemon(8) -u runs as the target
+# user and properly detaches from the terminal.
+procname="/usr/local/bin/dserver"
+command="/usr/sbin/daemon"
+command_args="-u dserver -o /var/log/dserver/dserver.log -- /usr/local/bin/dserver -cfg /usr/local/etc/dserver/dtail.json"
+
+start_precmd="dserver_precmd"
+
+dserver_precmd()
+{
+ install -d -o dserver -m 0755 /var/log/dserver
+ install -d -o dserver -m 0755 /var/run/dserver
+ install -d -o dserver -m 0755 /var/run/dserver/cache
+}
+
+load_rc_config $name
+run_rc_command "$1"