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
This commit is contained in:
Seena Fallah 2020-06-10 23:52:44 +04:30 committed by GitHub
parent 06b8f5a020
commit 7822449f25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,14 +5,11 @@
{% for option in nginx_logrotate_conf.options %}
{{ option }}
{% endfor %}
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi \
endscript
postrotate
{% if ansible_os_family == "Debian" %}
invoke-rc.d nginx rotate >/dev/null 2>&1
if [ -f /var/run/nginx.pid ]; then
kill -USR1 `cat /var/run/nginx.pid`
fi
{% else %}
nginx -s reopen
{% endif %}