Commit ddff0839 authored by Leo Koppelkamm's avatar Leo Koppelkamm Committed by Matt Holt

Make upstart script more fault tolerant and easier to debug (#824)

* Make Upstart script more fault tolerant and easier to debug

* update readme
parent e1a6b607
...@@ -9,5 +9,6 @@ Short recap: ...@@ -9,5 +9,6 @@ Short recap:
* Download Caddy in `/usr/bin/caddy` and execute `sudo setcap cap_net_bind_service=+ep /usr/bin/caddy`. * Download Caddy in `/usr/bin/caddy` and execute `sudo setcap cap_net_bind_service=+ep /usr/bin/caddy`.
* Save the upstart config file in `/etc/init/caddy.conf`. * Save the upstart config file in `/etc/init/caddy.conf`.
* Ensure that the folder `/etc/caddy` exists and that the subfolder .caddy is owned by `www-data`.
* Create a Caddyfile in `/etc/caddy/Caddyfile`. * Create a Caddyfile in `/etc/caddy/Caddyfile`.
* Now you can use `sudo service caddy start|stop|restart`. * Now you can use `sudo service caddy start|stop|restart`.
\ No newline at end of file
description "Caddy startup script" description "Caddy HTTP/2 web server"
author "Mathias Beke"
start on runlevel [2345] start on runlevel [2345]
stop on runlevel [016] stop on runlevel [016]
console log
setuid www-data setuid www-data
setgid www-data setgid www-data
...@@ -11,8 +11,13 @@ setgid www-data ...@@ -11,8 +11,13 @@ setgid www-data
respawn respawn
respawn limit 10 5 respawn limit 10 5
limit nofile 4096 4096 # Let's Encrypt certificates will be written to this directory.
env HOME=/etc/caddy
limit nofile 1048576 1048576
script script
exec /usr/bin/caddy -agree=true -conf=/etc/caddy/Caddyfile cd /etc/caddy
end script rootdir="$(mktemp -d -t "caddy-run.XXXXXX")"
\ No newline at end of file exec /usr/bin/caddy -agree -log=stdout -conf=/etc/caddy/Caddyfile -root=$rootdir
end script
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment