#!/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}" }