aboutsummaryrefslogtreecommitdiffstats
path: root/community/n2n/supernode.initd
diff options
context:
space:
mode:
Diffstat (limited to 'community/n2n/supernode.initd')
-rw-r--r--community/n2n/supernode.initd29
1 files changed, 29 insertions, 0 deletions
diff --git a/community/n2n/supernode.initd b/community/n2n/supernode.initd
new file mode 100644
index 00000000000..f1542edcf28
--- /dev/null
+++ b/community/n2n/supernode.initd
@@ -0,0 +1,29 @@
+#!/sbin/openrc-run
+
+name="${RC_SVCNAME}"
+description="N2N Supernode Daemon"
+
+[ ${RC_SVCNAME##*.} = $RC_SVCNAME ] || instance=${RC_SVCNAME##*.}
+[ -n "$instance" ] && : ${cfgfile:=/etc/n2n/supernode-$instance.conf}
+: ${cfgfile:=/etc/n2n/supernode.conf}
+
+command="/usr/sbin/supernode"
+command_args="$cfgfile ${command_opts}"
+command_args_foreground="-f"
+supervisor="supervise-daemon"
+
+pidfile="/run/${RC_SVCNAME}.pid"
+output_log="/var/log/${RC_SVCNAME}.log"
+error_log="/var/log/${RC_SVCNAME}.log"
+
+retry="${SUPERNODE_RETRY:-TERM/60/KILL/10}"
+
+depend() {
+ need net
+ after firewall
+}
+
+start_pre() {
+ checkpath -f -m 0644 -o "$command_user" "$output_log" "$error_log"
+ checkpath -f -m 0640 -o "$command_user" "$cfgfile"
+}