#!/sbin/openrc-run command=/usr/bin/caddy command_args="${caddy_args} -agree -email ${caddy_email} -conf ${caddy_caddyfile} -log stdout" pidfile=/var/run/caddy.pid name="Caddy HTTPD" description="Caddy is a webserver with letsencrypt support" depend() { need net } start() { ebegin "Starting Caddy" ulimit -n 8192 start-stop-daemon -S -u "$caddy_user:$caddy_group" -p "$pidfile" -m -b \ -e "CADDYPATH=$caddy_caddypath" \ -1 "${caddy_logfile}" -2 "${caddy_logfile}" \ -x "$command" -- $command_args eend $? "failed to start caddy" }