As it stands, the logrotate script tries to restart httpd after rotating the apache logs even when the daemon is not running. On machines where the web server is not always running, that means that an error message shows up in the logs every so often. The following patch on /etc/logrotate.d/apache uses /sbin/pidof, of the SysVinit rpm, to test whether the daemon is running before attempting the restart: *** /tmp/apache.orig Wed Jul 5 09:26:19 2000 --- /tmp/apache Wed Jul 5 09:28:09 2000 *************** *** 1,27 **** /var/log/httpd/access_log { missingok postrotate ! /usr/bin/killall -HUP httpd endscript } /var/log/httpd/agent_log { missingok postrotate ! /usr/bin/killall -HUP httpd endscript } /var/log/httpd/error_log { missingok postrotate ! /usr/bin/killall -HUP httpd endscript } /var/log/httpd/referer_log { missingok postrotate ! /usr/bin/killall -HUP httpd endscript } --- 1,27 ---- /var/log/httpd/access_log { missingok postrotate ! if [ "`/sbin/pidof httpd`" != "" ]; then /usr/bin/killall -HUP httpd; fi endscript } /var/log/httpd/agent_log { missingok postrotate ! if [ "`/sbin/pidof httpd`" != "" ]; then /usr/bin/killall -HUP httpd; fi endscript } /var/log/httpd/error_log { missingok postrotate ! if [ "`/sbin/pidof httpd`" != "" ]; then /usr/bin/killall -HUP httpd; fi endscript } /var/log/httpd/referer_log { missingok postrotate ! if [ "`/sbin/pidof httpd`" != "" ]; then /usr/bin/killall -HUP httpd; fi endscript }
This is already fixed in a different way in the development tree.