From 6f3ba344c1f8413a463dc6274f24ef00bf47e534 Mon Sep 17 00:00:00 2001 From: Alexander Hunt Date: Sun, 21 Jun 2026 17:11:32 -0700 Subject: Adding option to bind via unix socket --- init.d/penguins | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 init.d/penguins (limited to 'init.d') diff --git a/init.d/penguins b/init.d/penguins new file mode 100644 index 0000000..03835a3 --- /dev/null +++ b/init.d/penguins @@ -0,0 +1,45 @@ +#!/sbin/openrc-run + +# OpenRC service for penguins.lan. +# +# Install: +# install -Dm755 init.d/penguins /etc/init.d/penguins +# install -Dm644 conf.d/penguins /etc/conf.d/penguins +# rc-update add penguins default +# rc-service penguins start +# +# The binary resolves .env, ./db, ./templates and ./static relative to its +# working directory, so directory= must point at the deploy tree. + +name="penguins.lan" +description="penguins.lan portal, scheduler and DNS server" + +: "${penguins_user:=penguins}" +: "${penguins_group:=penguins}" +: "${penguins_dir:=/opt/penguins.lan}" +: "${penguins_bin:=${penguins_dir}/penguins}" +: "${penguins_flags:=-server -scheduler -dns -migrate}" + +command="${penguins_bin}" +command_args="${penguins_flags}" +command_user="${penguins_user}:${penguins_group}" +directory="${penguins_dir}" + +supervisor="supervise-daemon" +respawn_delay=5 +respawn_max=0 +output_log="/var/log/penguins.log" +error_log="/var/log/penguins.log" + +# Binding DNS on port 53 (and HTTP on 80) needs this capability when not root. +capabilities="^cap_net_bind_service" + +depend() { + need net + after firewall +} + +start_pre() { + checkpath --directory --owner "${penguins_user}:${penguins_group}" --mode 0750 "${penguins_dir}/db" + checkpath --file --owner "${penguins_user}:${penguins_group}" --mode 0640 "${output_log}" +} -- cgit v1.3