logrotate, apache2, PidFile hardcoded

Bug #73363 reported by sewert
4
Affects Status Importance Assigned to Milestone
apache2 (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Binary package hint: apache2-common

Hello,

short: don't hardcode pidfile path in /etc/logrotate.d/apache2

I'm using ubuntu 6.06 of a server. I put apache in a jail via mod_chroot and because of that I had to change the pidfile location. The pidfile is created in the jail, so you have to make a symlink to the pidfile at the original location to the jail pidfile. But in ubuntu /var/run is a TMPFS and the link would be erased an each restart. So I chose to place the pidfile in /var/run.apache2/ . Because of that logrotate which has a hardcoded location for the pidfile, does not restart apache on logrotate. The result is that apache still writes into the old, now renamed logfile and AWstats is loosing those entries.

Would it be possbile to do something similar to what is done in the init script. Something like:
AP_CONF="/etc/apache2/apache2.conf"
for i in $AP_CONF `awk '$1 ~ /^\s*[Ii]nclude$/ && $2 ~ /^\// {print $2}' $AP_CONF`; do
   PIDFILE=`grep -i ^PidFile $i | tail -n 1 | awk '{print $2}'`
   if [ -e "$PIDFILE" ] ; then
       FOUNDPIDFILE="$PIDFILE"
   fi
done

This get the pidfile location from the configuration

Mathias Gug (mathiaz)
Changed in apache2:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Stefan Fritsch (sf-sfritsch) wrote :

This has been fixed in 2.2.8-1

Changed in apache2 (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.