b685f54711
This change introduces a random delay between 0 and 5 minutes for logrotate as part of the pre-rotate process for apache2. This sleep is an attempt to prevent all apache services from being restarted at the exact same time for a cluster. Additionally we have found that soemtimes apache will crash with mod_wsgi so this change updates the two places where we use a graceful restart to also include a restart of apache if the graceful is unsuccessful. Change-Id: I0585835ca67e4137e39056b51965c922bb0118cd Closes-Bug: 1491576
22 lines
539 B
Plaintext
22 lines
539 B
Plaintext
# This file managed via puppet
|
|
/var/log/apache2/*.log {
|
|
weekly
|
|
missingok
|
|
rotate <%= @logrotate_rotate %>
|
|
compress
|
|
delaycompress
|
|
notifempty
|
|
create 640 root adm
|
|
sharedscripts
|
|
postrotate
|
|
if /etc/init.d/apache2 status > /dev/null ; then \
|
|
(/usr/sbin/apachectl graceful) || (/usr/sbin/apachectl restart)
|
|
fi;
|
|
endscript
|
|
prerotate
|
|
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
|
|
run-parts /etc/logrotate.d/httpd-prerotate; \
|
|
fi; \
|
|
endscript
|
|
}
|