diff options
Diffstat (limited to 'www-servers/caddy/files/initd')
-rw-r--r-- | www-servers/caddy/files/initd | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/www-servers/caddy/files/initd b/www-servers/caddy/files/initd new file mode 100644 index 000000000000..3f080d202e1e --- /dev/null +++ b/www-servers/caddy/files/initd @@ -0,0 +1,26 @@ +#!/sbin/openrc-run + +description="Caddy web server" +pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"} +command="/usr/bin/caddy" +command_user="${command_user:-"http:http"}" +command_args="${command_args:-"run --config /etc/caddy/caddy_config.json"}" +command_background="true" +logfile=/var/log/${RC_SVCNAME}/${RC_SVCNAME}.log +start_stop_daemon_args="--user ${command_user%:*} --group ${command_user#*:} + --stdout ${logfile} --stderr ${logfile}" + +: "${supervisor:=supervise-daemon}" +: "${respawn_delay:=5}" +: "${respawn_max:=10}" +: "${respawn_period:=60}" + +depend() { + need net +} + +start() { + checkpath --directory --mode 755 --owner root "${pidfile%/*}" + checkpath --directory --mode 755 --owner "${command_user}" "${logfile%/*}" + default_start +} |