Commit 5af1d94a authored by Rafael Monnerat's avatar Rafael Monnerat

apache-frontend: Delay reload apache configuration

  Wait for 60 to reload apache configuration in order to accumulate
  several logrotate runs.

  If the amount of slaves are too high, the number of logs are high,
  so the entries on logrotate are also high. So it is enough to DDoS
  with a huge amount of 'kill -1', so delay is the only way to avoid
  to re-implement logrotate existing features.
parent d604ad6a
......@@ -19,7 +19,7 @@ md5sum = f686f765e55d1dce2e55a400f0714b3e
[template-apache-frontend]
filename = instance-apache-frontend.cfg
md5sum = e2f60121bc1116319b4d20b4c4badc1c
md5sum = ea599162be999680cd43d4605762219f
[template-apache-replicate]
filename = instance-apache-replicate.cfg.in
......@@ -92,3 +92,7 @@ md5sum = a5186f666acb2f040ede04c91e60408f
[template-nginx-notebook-slave-virtualhost]
filename = templates/nginx-notebook-slave.conf.in
md5sum = 82d74a7f2aceb2b4a7acc6259291b7f2
[template-apache-lazy-script-call.sh.in]
filename = templates/apache-lazy-script-call.sh.in
md5sum = f519bea5b54448c5ad486c4ef6c0fb23
......@@ -141,6 +141,11 @@ url = ${:_profile_base_location_}/templates/nginx.cfg.in
output = ${buildout:directory}/template-nginx.cfg.in
mode = 0644
[template-apache-lazy-script-call]
<=download-template
filename = apache-lazy-script-call.sh.in
[template-nginx-eventsource-slave-virtualhost]
<=download-template
filename = nginx-eventsource-slave.conf.in
......
......@@ -508,6 +508,19 @@ mode = 0700
extra-context =
key content apache-configuration:frontend-graceful-command
[frontend-apache-lazy-graceful]
< = jinja2-template-base
template = ${template-apache-lazy-script-call:output}
rendered = $${directory:bin}/frontend-apache-lazy-graceful
mode = 0700
extra-context =
raw wait_time 60
key content apache-configuration:frontend-graceful-command
# Promises checking configuration:
[promise-frontend-apache-configuration]
< = jinja2-template-base
......
#!/bin/bash
PID=$$
PIDFILE=~/my.pid
if [ ! -f $PIDFILE ]; then
echo $PID >> $PIDFILE
else
ps --pid `cat $PIDFILE` &>/dev/null
if [ $? -eq 0 ]; then
echo "Skipped"
else
echo $PID >> $PIDFILE
sleep {{ wait_time }}
{{ lazy_command }}
fi
fi
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