Bug 13498 - logrotate script tries to restart not-running httpd
logrotate script tries to restart not-running httpd
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: apache (Show other bugs)
6.0
i386 Linux
low Severity low
: ---
: ---
Assigned To: Nalin Dahyabhai
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-07-05 09:47 EDT by ecashin
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-07-05 09:47:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description ecashin 2000-07-05 09:47:08 EDT
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
  }
Comment 1 Nalin Dahyabhai 2000-07-05 11:39:01 EDT
This is already fixed in a different way in the development tree.

Note You need to log in before you can comment on or make changes to this bug.