Commit 7459f41e authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend: Do not share pidfile

Only etc/service/frontend_{caddy,nginx} shall use pidfile, as other tools
can remove the pidfile.
parent a10d9461
......@@ -19,7 +19,7 @@ md5sum = 906e5bd66b1265b8109a86b6ab46e91f
[template-apache-frontend]
filename = instance-apache-frontend.cfg
md5sum = 21f4e3ac43b662e734ce1bd6c98516a6
md5sum = b77eb3a5aadd3ed2b4264a99b8dfeab2
[template-apache-replicate]
filename = instance-apache-replicate.cfg.in
......@@ -71,7 +71,7 @@ md5sum = 8cde04bfd0c0e9bd56744b988275cfd8
[template-caddy-wrapper]
filename = templates/caddy-wrapper.in
md5sum = 5213d8aca7231a4229ae5b8becce655f
md5sum = c5816275757124613920078b6bec1caf
[template-trafficserver-records-config]
filename = templates/trafficserver/records.config.jinja2
......
......@@ -256,11 +256,10 @@ extra-context =
key conf dynamic-caddy-frontend-template:rendered
key log caddy-configuration:error-log
key grace instance-parameter:configuration.mpm-graceful-shutdown-timeout
key pidfile caddy-configuration:pid-file
[caddy-frontend]
recipe = slapos.cookbook:wrapper
command-line = $${caddy-wrapper:rendered}
command-line = $${caddy-wrapper:rendered} -pidfile $${caddy-configuration:pid-file}
wrapper-path = $${directory:service}/frontend_caddy
wait-for-files =
$${ca-frontend:cert-file}
......@@ -682,17 +681,21 @@ curl_path = ${curl:location}/bin/curl
#######################
# Nginx
#
[nginx-frontend]
[nginx-wrapper]
< = jinja2-template-base
template = ${template-caddy-wrapper:output}
rendered = $${directory:service}/frontend_nginx
rendered = $${directory:bin}/nginx-wrapper
mode = 0700
extra-context =
raw caddy ${caddy:output}
key conf nginx-configuration:output
key log nginx-configuration:error_log
key grace instance-parameter:configuration.mpm-graceful-shutdown-timeout
key pidfile nginx-configuration:pid-file
[nginx-frontend]
recipe = slapos.cookbook:wrapper
command-line = $${nginx-wrapper:rendered} -pidfile $${nginx-configuration:pid-file}
wrapper-path = $${directory:service}/frontend_nginx
[nginx-configuration]
recipe = slapos.recipe.template
......@@ -710,7 +713,7 @@ worker_connections = 1024
slave-configuration-directory = $${caddy-directory:nginx-slave-configuration}
pid-file = $${directory:run}/nginx.pid
nginx-graceful-command = $${:nginx-configuration-verification}; if [ $? -eq 0 ]; then kill -HUP $(cat $${:pid-file}); fi
nginx-configuration-verification = $${nginx-frontend:rendered} -validate
nginx-configuration-verification = $${nginx-wrapper:rendered} -validate
ssl_certificate = $${ca-frontend:cert-file}
ssl_key = $${ca-frontend:key-file}
......
......@@ -5,7 +5,6 @@ exec {{ caddy }} \
-log {{ log }} \
-http2=true \
-grace {{ grace }}s \
-pidfile {{ pidfile }} \
-disable-http-challenge \
-disable-tls-sni-challenge \
"$@"
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