blob: 03835a311fbfe8b9cf486f8ee7f735d6a3df27ef (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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}"
}
|