Originally Posted by
dtfinch
What does your "/etc/logrotate.d/apache2" look like? Normally logrotate's postrotate for apache2 calls "/etc/init.d/apache2 reload" after rotating, which performs a graceful restart so that apache will close and reopen its logs. But it sounds like that's not happening.
root@web49:/etc/logrotate.d# cat apache2
Code:
/var/log/apache2/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 640 root logview
sharedscripts
postrotate
if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then
/etc/init.d/apache2 reload > /dev/null
fi
endscript
}
I tried to run this command manually to see if it helped, but it seems an apache reload doesn't release the file handle, only restart does.
root@web49:/etc/logrotate.d# /etc/init.d/apache2 reload
* Reloading web server config apache2 [ OK ]
root@web49:/etc/logrotate.d# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda8 9.2G 6.1G 2.7G 70% /var