#!/bin/sh
#
-# Startup script for the Apache Web Server
+# apache Apache Web Server
#
-# chkconfig: 345 85 15
-# description: Apache is a World Wide Web server. It is used to serve \
-# HTML files and CGI.
-# processname: httpd
-# pidfile: /var/run/httpd.pid
-# config: /etc/httpd/conf/access.conf
-# config: /etc/httpd/conf/httpd.conf
-# config: /etc/httpd/conf/srm.conf
-
-# Source function library.
+# chkconfig: 345 85 15
+# description: Apache is a World Wide Web server. It is used to serve \
+# HTML files and CGI.
+# processname: httpd
+# pidfile: /var/run/httpd.pid
+# config: /etc/httpd/conf/access.conf
+# config: /etc/httpd/conf/httpd.conf
+# config: /etc/httpd/conf/srm.conf
+
+
+# Source function library
. /etc/rc.d/init.d/functions
+# Get network config
+. /etc/sysconfig/network
+
+# Get service config
+[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
+
# Check that networking is up.
-[ "${NETWORKING}" = "no" ] && exit0
+[ "${NETWORKING}" = "no" ] && echo "Error: Networking is down"; exit 0
+
-# Try set service nice level
-if [ -f /etc/sysconfig/apache ]; then
- . /etc/sysconfig/apache
-fi
# See how we were called.
case "$1" in
start)
- show Starting httpd
- daemon httpd
+ # Check if the service is already running?
+ if [ ! -f /var/lock/subsys/httpd ]; then
+ show Starting httpd
+ daemon httpd
+ else
+ echo "httpd already is running"
+ fi
touch /var/lock/subsys/httpd
;;
stop)
status)
status httpd
;;
- restart)
+ restart|reload)
$0 stop
$0 start
;;