aboutsummaryrefslogtreecommitdiffstats
path: root/www-servers/caddy/files
diff options
context:
space:
mode:
Diffstat (limited to 'www-servers/caddy/files')
-rw-r--r--www-servers/caddy/files/caddy.initd22
1 files changed, 22 insertions, 0 deletions
diff --git a/www-servers/caddy/files/caddy.initd b/www-servers/caddy/files/caddy.initd
new file mode 100644
index 0000000..a9cf7ea
--- /dev/null
+++ b/www-servers/caddy/files/caddy.initd
@@ -0,0 +1,22 @@
+#!/sbin/openrc-run
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+name="${RC_SVCNAME}"
+
+config="${CADDY_CONFIG:-/etc/caddy/Caddyfile}"
+pidfile="/run/${RC_SVCNAME}/caddy.pid"
+
+command="caddy"
+command_args="run --config ${config} --pidfile ${pidfile}"
+command_user="caddy:http"
+command_background=yes
+
+depend() {
+ use net
+ after dns
+}
+
+start_pre() {
+ checkpath -q -d -o "${command_user}" "/run/${RC_SVCNAME}"
+}