]> git.pld-linux.org Git - packages/apache.git/blobdiff - apache.init
- check config before doing apache restart
[packages/apache.git] / apache.init
index 034cfcc4bc53702bb10a1cb95bd9f130baf3bc0e..72fe83c6098147473eff6280e371ab05c4993fdb 100644 (file)
@@ -19,7 +19,7 @@
 . /etc/sysconfig/network
 
 # Get service config
-[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
+[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
 
 # Check that networking is up.
 if is_yes "${NETWORKING}"; then
@@ -60,7 +60,8 @@ case "$1" in
        # Stop daemons.
        if [ -f /var/lock/subsys/httpd ]; then
                msg_stopping httpd.${HTTPD_MPM}
-               daemon --waitforname httpd.${HTTPD_MPM} --waitfortime 60 httpd.${HTTPD_MPM} $CFG -k stop
+               [ -n "$(pidofproc httpd.${HTTPD_MPM})" ] && OPT="--waitforname httpd.${HTTPD_MPM} --waitfortime 60" || OPT=
+               daemon $OPT httpd.${HTTPD_MPM} $CFG -k stop
                # Delete pidfile only when apache was called successfully
                if [ $? -eq 0 ]; then
                        rm -f /var/lock/subsys/httpd /var/run/httpd.pid /var/run/httpd.loc* >/dev/null 2>&1
This page took 0.040498 seconds and 4 git commands to generate.