]> git.pld-linux.org Git - packages/apache.git/blob - apache.init
- touch /var/lock/subsys/httpd only after run httpd,
[packages/apache.git] / apache.init
1 #!/bin/sh
2 #
3 # apache        Apache Web Server
4 #
5 # chkconfig:    345 85 15
6 # description:  Apache is a World Wide Web server.  It is used to serve \
7 #               HTML files and CGI.
8 # processname:  httpd
9 # pidfile:      /var/run/httpd.pid
10 # config:       /etc/httpd/conf/access.conf
11 # config:       /etc/httpd/conf/httpd.conf
12 # config:       /etc/httpd/conf/srm.conf
13
14
15 # Source function library
16 . /etc/rc.d/init.d/functions
17
18 # Get network config
19 . /etc/sysconfig/network
20
21 # Get service config
22 [ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
23
24 # Check that networking is up.
25 if [ "${NETWORKING}" = "no" ]; then
26         echo "WARNING: Networking is down. Apache can't be runed."
27         exit 1
28 fi
29
30 # See how we were called.
31 case "$1" in
32   start)
33         # Check if the service is already running?
34         if [ ! -f /var/lock/subsys/httpd ]; then
35                 show Starting httpd
36                 daemon httpd
37                 touch /var/lock/subsys/httpd
38         else
39                 echo "httpd already is running"
40         fi
41         ;;
42   stop)
43         show Shutting down httpd
44         killproc httpd  
45         rm -f /var/lock/subsys/httpd /var/run/httpd.pid /var/run/httpd.loc*
46         ;;
47   status)
48         status httpd
49         /usr/sbin/httpd -S
50         ;;
51   restart|reload)
52         $0 stop
53         $0 start
54         ;;
55   *)
56         echo "Usage: $0 {start|stop|restart|status}"
57         exit 1
58         ;;
59 esac
60
61 exit 0
This page took 0.028319 seconds and 4 git commands to generate.