Sophie

Sophie

distrib > Mageia > 2 > i586 > by-pkgid > a59d99d921b61531305538efcdff3a64 > files > 39

apache-2.2.24-1.1.mga2.src.rpm

--- support/apachectl.in	2006-07-12 05:38:44.000000000 +0200
+++ support/apachectl.in.oden	2010-10-18 15:45:24.859893138 +0200
@@ -15,6 +15,10 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+# Source the /etc/sysconfig/httpd file.
+if [ -f /etc/sysconfig/httpd ]; then
+    . /etc/sysconfig/httpd
+fi
 #
 # Apache control script designed to allow an easy command line interface
 # to controlling Apache.  Written by Marc Slemko, 1997/08/23
@@ -41,7 +45,10 @@
 # --------------------                              --------------------
 # 
 # the path to your httpd binary, including options if necessary
-HTTPD='@exp_sbindir@/@progname@'
+# Source the /etc/sysconfig/httpd file.
+if [ -z "$HTTPD" ]; then
+    HTTPD='@exp_sbindir@/@progname@'
+fi
 #
 # pick up any necessary environment variables
 if test -f @exp_sbindir@/envvars; then
@@ -55,7 +62,9 @@
 #
 # the URL to your server's mod_status status page.  If you do not
 # have one, then status and fullstatus will not work.
-STATUSURL="http://localhost:@PORT@/server-status"
+if [ -z "$STATUSURL" ]; then
+    STATUSURL="http://localhost:@PORT@/server-status"
+fi
 #
 # Set this variable to a command that increases the maximum
 # number of file descriptors allowed per child process. This is
@@ -75,9 +84,14 @@
     ARGV="-h"
 fi
 
+# this is to make it work as expected
+if [ -x /etc/rc.d/init.d/httpd ] ; then
+    MDV_DEFINES=`/etc/rc.d/init.d/httpd show_defines`
+fi
+
 case $ARGV in
 start|stop|restart|graceful|graceful-stop)
-    $HTTPD -k $ARGV
+    $HTTPD -k $ARGV $HTTPDCONF $OPTIONS $MDV_DEFINES
     ERROR=$?
     ;;
 startssl|sslstart|start-SSL)
@@ -87,7 +101,7 @@
     ERROR=2
     ;;
 configtest)
-    $HTTPD -t
+    $HTTPD -t $HTTPDCONF $OPTIONS $MDV_DEFINES
     ERROR=$?
     ;;
 status)
@@ -97,7 +111,7 @@
     $LYNX $STATUSURL
     ;;
 *)
-    $HTTPD $ARGV
+    $HTTPD $ARGV $HTTPDCONF $OPTIONS $MDV_DEFINES
     ERROR=$?
 esac