Skip to content

Commit 7822449

Browse files
authored
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
1 parent 06b8f5a commit 7822449

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

templates/logrotate/nginx.j2

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@
55
{% for option in nginx_logrotate_conf.options %}
66
{{ option }}
77
{% endfor %}
8-
prerotate
9-
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
10-
run-parts /etc/logrotate.d/httpd-prerotate; \
11-
fi \
12-
endscript
138
postrotate
149
{% if ansible_os_family == "Debian" %}
15-
invoke-rc.d nginx rotate >/dev/null 2>&1
10+
if [ -f /var/run/nginx.pid ]; then
11+
kill -USR1 `cat /var/run/nginx.pid`
12+
fi
1613
{% else %}
1714
nginx -s reopen
1815
{% endif %}

0 commit comments

Comments
 (0)