On 3/11/10, David Coppa <dco...@gmail.com> wrote:
>  Is this something utterly stupid?
>
>  just wasting some time...
>  david
>
>  --- apachectl.orig      Wed Mar  3 23:20:53 2010
>  +++ apachectl           Thu Mar 11 20:11:31 2010
>  @@ -27,6 +27,9 @@
>   # the path to your httpd binary, including options if necessary
>   HTTPD=/usr/sbin/httpd
>   #
>  +# the path to your httpd configuration file
>  +CONFIGFILE=/var/www/conf/httpd.conf

it may fail in case one uses -d and/or -f flags to the httpd (e.g.
sets them in /etc/rc.conf or /etc/rc.conf.local)

>  +#
>   # a command that outputs a formatted text version of the HTML at the
>   # url given on the command line.  Designed for lynx, however other
>   # programs may work.
>  @@ -116,11 +119,19 @@
>             fi
>         else
>             if $HTTPD $RCFLAGS -t >/dev/null 2>&1; then
>  -               if kill -HUP $PID ; then
>  -                   echo "$0 $ARG: httpd restarted"
>  +               if ps ax | grep $PID | grep chroot >/dev/null && \
>  +                       egrep '^ *LoadModule' $CONFIGFILE >/dev/null
>  +               then
>  +                   echo "$0 $ARG: httpd chrooted with external modules"
>  +                   echo "$0 $ARG: trying stop/start"
>  +                   $0 stop && sleep 2 && $0 start
>                 else
>  -                   echo "$0 $ARG: httpd could not be restarted"
>  -                   ERROR=6
>  +                   if kill -HUP $PID ; then
>  +                       echo "$0 $ARG: httpd restarted"
>  +                   else
>  +                       echo "$0 $ARG: httpd could not be restarted"
>  +                       ERROR=6
>  +                   fi
>                 fi
>             else
>                 echo "$0 $ARG: configuration broken, ignoring restart"

Reply via email to