Public bug reported:

Binary package hint: apache2-common

I've noticed that /etc/init.d/apache2, gives an error when trying to
grep the pid file, when an include expression (mods-enabled/*.conf)
would include nothing.

Server version: Apache/2.0.55
Server built:   Sep 27 2006 16:52:14

The patch below solves the problem (though there might be better ways)


--- apache2.org 2007-02-13 16:21:35.000000000 +0100
+++ apache2     2007-02-16 01:02:31.000000000 +0100
@@ -37,9 +37,11 @@
        # here, but only first-level includes are supported, not nested ones
 
        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
-                       PID=`cat $PIDFILE`
+               if [ -e $i ] ; then                             
+                       PIDFILE=`grep -i ^PidFile $i | tail -n 1 | awk '{print 
$2}'`
+                       if [ -e "$PIDFILE" ]; then
+                               PID=`cat $PIDFILE`
+                       fi
                fi
        done

** Affects: apache2 (Ubuntu)
     Importance: Undecided
         Status: Unconfirmed

-- 
/etc/init.d/apache2 displays grep error when including empty dir
https://launchpad.net/bugs/85566

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to