Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 98496

Summary: apache can be started purely by logrotate runs, if the log files need rotating
Product: Gentoo Linux Reporter: James Rowe <jnrowe>
Component: [OLD] ServerAssignee: Apache Team - Bugzilla Reports <apache-bugs>
Status: VERIFIED TEST-REQUEST    
Severity: minor CC: dang
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description James Rowe 2005-07-09 13:50:48 UTC
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
Comment 1 Daniel Gryniewicz (RETIRED) gentoo-dev 2005-07-10 08:30:13 UTC
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.
Comment 2 PIERRE BenoƮt 2005-07-23 18:15:39 UTC
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
Comment 3 Michael Stewart (vericgar) (RETIRED) gentoo-dev 2005-07-28 15:59:54 UTC
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!
Comment 4 James Rowe 2005-08-13 06:09:54 UTC
  Sorry for the delay(holiday), the problem has been solved in
apache-2.0.54-r13.  Thanks!
Comment 5 Luca Longinotti (RETIRED) gentoo-dev 2006-06-05 12:28:58 UTC
Was confirmed as fixed, closing then.
Best regards, CHTEKK.