ansible-role-nginx/templates/logrotate/nginx.j2
Seena Fallah 7822449f25
Fix bug on debian logrotate scripts (#260)
prerotate isn't working if there is no httpd-prerotate and it's no more needed and also postrotate can be kill -USR1
2020-06-10 21:22:44 +02:00

18 lines
369 B
Django/Jinja

{% for path in nginx_logrotate_conf.paths %}
{{ path }}
{% endfor %}
{
{% for option in nginx_logrotate_conf.options %}
{{ option }}
{% endfor %}
postrotate
{% if ansible_os_family == "Debian" %}
if [ -f /var/run/nginx.pid ]; then
kill -USR1 `cat /var/run/nginx.pid`
fi
{% else %}
nginx -s reopen
{% endif %}
endscript
}