Commit 324c08d0 authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend: Set open files soft limit

Caddy by itself does not raise soft limit of open files, so it has to be set
by the wrapper.

As slapos.cookbook:wrapper can't be used for such case, the
slapos.recipe.template:jinja2 recipe inline style is used to have full
control over the created wrapper.

/reviewed-on !678
parent 62a67536
...@@ -22,7 +22,7 @@ md5sum = c801b7f9f11f0965677c22e6bbe9281b ...@@ -22,7 +22,7 @@ md5sum = c801b7f9f11f0965677c22e6bbe9281b
[template-apache-frontend] [template-apache-frontend]
filename = instance-apache-frontend.cfg.in filename = instance-apache-frontend.cfg.in
md5sum = c6d78b2856d9d0ec63728e668e3395d8 md5sum = 378f6da53a02b2bfe7777a493fc95585
[template-caddy-replicate] [template-caddy-replicate]
filename = instance-apache-replicate.cfg.in filename = instance-apache-replicate.cfg.in
......
...@@ -320,32 +320,36 @@ extra-context = ...@@ -320,32 +320,36 @@ extra-context =
# BBB: SlapOS Master non-zero knowledge END # BBB: SlapOS Master non-zero knowledge END
[caddy-wrapper] [caddy-wrapper]
recipe = slapos.cookbook:wrapper recipe = slapos.recipe.template:jinja2
environment = template = inline:
CADDYPATH=${directory:frontend_cluster} #!/bin/sh
command-line = {{ parameter_dict['caddy'] }} export CADDYPATH=${directory:frontend_cluster}
-conf ${dynamic-caddy-frontend-template:rendered} ulimit -n $(ulimit -Hn)
-log ${caddy-configuration:error-log} exec {{ parameter_dict['caddy'] }} \
-log-roll-mb 0 -conf ${dynamic-caddy-frontend-template:rendered} \
-log ${caddy-configuration:error-log} \
-log-roll-mb 0 \
{% if instance_parameter['configuration.global-disable-http2'].lower() in TRUE_VALUES %} {% if instance_parameter['configuration.global-disable-http2'].lower() in TRUE_VALUES %}
-http2=false -http2=false \
{% else %} {% else %}
-http2=true -http2=true \
{% endif %} {% endif %}
{% if instance_parameter['configuration.enable-quic'].lower() in TRUE_VALUES %} {% if instance_parameter['configuration.enable-quic'].lower() in TRUE_VALUES %}
-quic -quic \
{% endif %} {% endif %}
-grace {{ instance_parameter['configuration.mpm-graceful-shutdown-timeout'] }}s -grace {{ instance_parameter['configuration.mpm-graceful-shutdown-timeout'] }}s \
-disable-http-challenge -disable-http-challenge \
-disable-tls-alpn-challenge -disable-tls-alpn-challenge \
wrapper-path = ${directory:bin}/caddy-wrapper "$@"
rendered = ${directory:bin}/caddy-wrapper
mode = 0755
[caddy-frontend] [caddy-frontend]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
command-line = ${caddy-wrapper:wrapper-path} -pidfile ${caddy-configuration:pid-file} command-line = ${caddy-wrapper:rendered} -pidfile ${caddy-configuration:pid-file}
wrapper-path = ${directory:service}/frontend_caddy wrapper-path = ${directory:service}/frontend_caddy
hash-existing-files = ${buildout:directory}/software_release/buildout.cfg hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
hash-files = ${caddy-wrapper:wrapper-path} hash-files = ${caddy-wrapper:rendered}
[not-found-html] [not-found-html]
recipe = slapos.cookbook:symbolic.link recipe = slapos.cookbook:symbolic.link
...@@ -594,7 +598,7 @@ rendered = ${directory:bin}/frontend-caddy-validate ...@@ -594,7 +598,7 @@ rendered = ${directory:bin}/frontend-caddy-validate
mode = 0700 mode = 0700
last_state_file = ${directory:run}/caddy_configuration_last_state last_state_file = ${directory:run}/caddy_configuration_last_state
extra-context = extra-context =
key wrapper caddy-wrapper:wrapper-path key wrapper caddy-wrapper:rendered
key caddy_configuration_state frontend-caddy-configuration-state-validate:rendered key caddy_configuration_state frontend-caddy-configuration-state-validate:rendered
key last_state_file :last_state_file key last_state_file :last_state_file
......
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