You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Arnold Daniels <in...@adaniels.nl> on 2007/02/16 01:14:04 UTC

small patch init.d

Hi,

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

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

The attached patch solves this, though I don't know if this is the best way.

Please excuse me if this is already solved in a newer version.

Best regards,
Arnold

Re: small patch init.d

Posted by Sander Temme <sc...@apache.org>.
Hi Arnold,

On Feb 15, 2007, at 4:14 PM, Arnold Daniels wrote:

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

The httpd we distribute doesn't contain any scripts for init.d: it is  
up to the user or packager/distributor to integrate Apache into their  
startup scripts.

 From the name 'apache2', it looks like you're working with Ubuntu or  
another Debian variant. Perhaps you can approach the person who  
packages Apache for your distribution directly. They may be on this  
list, but you're probably better served with a direct line of  
communications.

Regards,

S.

> Server version: Apache/2.0.55
> Server built:   Sep 27 2006 16:52:14
>
> The attached patch solves this, though I don't know if this is the  
> best way.
>
> Please excuse me if this is already solved in a newer version.
>
> Best regards,
> Arnold
> --- 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


-- 
sctemme@apache.org            http://www.temme.net/sander/
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF