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