Create Anubis OpenRC init.d script (#561)
Signed-off-by: Anna @CyberTailor <cyber@sysrq.in>
This commit is contained in:
parent
fa1f2355ea
commit
086f43e3ca
3 changed files with 59 additions and 0 deletions
34
run/openrc/anubis.initd
Normal file
34
run/openrc/anubis.initd
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#!/sbin/openrc-run
|
||||
# shellcheck shell=sh
|
||||
|
||||
instance=${RC_SVCNAME#*.}
|
||||
|
||||
description="Anubis HTTP defense proxy (instance ${instance})"
|
||||
supervisor="supervise-daemon"
|
||||
command="/usr/bin/anubis"
|
||||
command_args="\
|
||||
-bind ${ANUBIS_BIND_PORT:-/run/anubis_${instance?}/anubis.sock -bind-network unix} \
|
||||
-metrics-bind ${ANUBIS_METRICS_BIND_PORT:-/run/anubis_${instance?}/metrics.sock -metrics-bind-network unix} \
|
||||
-target ${ANUBIS_TARGET:-http://localhost:3923} \
|
||||
-difficulty ${ANUBIS_DIFFICULTY:-4} \
|
||||
${ANUBIS_OPTS}
|
||||
"
|
||||
command_background=1
|
||||
pidfile="/run/anubis_${instance?}/anubis.pid"
|
||||
|
||||
: "${command_user:=anubis:anubis}"
|
||||
|
||||
depend() {
|
||||
use net firewall
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
if [ "${instance?}" = "${RC_SVCNAME?}" ]; then
|
||||
eerror "${RC_SVCNAME?} cannot be started directly. You must create"
|
||||
eerror "symbolic links to it for the services you want to start"
|
||||
eerror "and add those to the appropriate runlevels."
|
||||
return 1
|
||||
fi
|
||||
|
||||
checkpath -d -o "${command_user?}" "/run/anubis_${instance?}"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue