The logrotate config file for apache2 will start apache if the logs are rotated. And, of course, if it is started by the reload function it doesn't add a symlink to the /var/lib/init.d/started directory and can't even be stopped with the initscript. I was tempted to attach a patch with something like: [ -h /var/lib/init.d/started/apache2 ] added to the logrotate file to this bug, but I don't really think it is the right solution. Mainly because someone may have started apache with apachectl, and then logrotate still won't do the right thing. I think the real solution is probably to add a test for a lockfile to /etc/init.d/apache2:reload(). So I've decided to annoy even myself and just file a bug without a reasonable possible resolution :/ Reproducible: Always Steps to Reproduce: 1. emerge apache logrotate 2. don't start apache with the init script 3. rotate the logfiles. Note it is important that the logfiles are actually rotated if they do not need rotating the reload script isn't run. Actual Results: Apache is started Expected Results: Rotated the logs, and restarted apache /only/ if it is already running
The logrotate files for packages are supplied by the packages, not by logrotate. It sounds like a bug in the apache reload script, rather than in logrotate.
using: { /etc/init.d/apache2 status && /etc/init.d/apache2 reload; } > /dev/null 2>&1 || true instead of /etc/init.d/apache2 reload > /dev/null 2>&1 || true can fix this
This is fixed in apache-2.0.54-r13 by checking to see if apache is running when reload is called, and if not, errors out. Please test and see if it works for you. Thanks!
Sorry for the delay(holiday), the problem has been solved in apache-2.0.54-r13. Thanks!
Was confirmed as fixed, closing then. Best regards, CHTEKK.