From 40aaaa64e86ba6710bbeb31c4615a6ce80e75e11 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 28 Apr 2021 20:21:43 +0100 Subject: gentoo resync : 28.04.2021 --- www-servers/caddy/files/initd | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 www-servers/caddy/files/initd (limited to 'www-servers/caddy/files/initd') 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 +} -- cgit v1.2.3