mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-29 12:16:16 +08:00
Make upstart script more fault tolerant and easier to debug (#824)
* Make Upstart script more fault tolerant and easier to debug * update readme
This commit is contained in:
parent
e1a6b60736
commit
ddff08392a
1
dist/init/linux-upstart/README.md
vendored
1
dist/init/linux-upstart/README.md
vendored
|
@ -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`.
|
13
dist/init/linux-upstart/caddy.conf
vendored
13
dist/init/linux-upstart/caddy.conf
vendored
|
@ -1,9 +1,9 @@
|
||||||
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
|
||||||
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
|
||||||
|
rootdir="$(mktemp -d -t "caddy-run.XXXXXX")"
|
||||||
|
exec /usr/bin/caddy -agree -log=stdout -conf=/etc/caddy/Caddyfile -root=$rootdir
|
||||||
end script
|
end script
|
Loading…
Reference in New Issue
Block a user