]> git.pld-linux.org Git - packages/apache.git/blob - apache.init
- apache2
[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 is_no "${NETWORKING}"; then
26         # nls "ERROR: Networking is down. %s can't be run." <service>
27         msg_network_down httpd
28         exit 1
29 fi
30
31 # See how we were called.
32 case "$1" in
33   start)
34         # Check if the service is already running?
35         if [ ! -f /var/lock/subsys/httpd ]; then
36                 msg_starting httpd
37                 daemon httpd $HTTPD_OPTS
38                 RETVAL=$?
39                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/httpd
40         else
41                 msg_already_running httpd
42                 exit 1
43         fi
44         ;;
45   stop)
46         # Stop daemons.
47         if [ -f /var/lock/subsys/httpd ]; then
48                 msg_stopping httpd
49                 killproc httpd
50                 rm -f /var/lock/subsys/httpd /var/run/httpd.pid /var/run/httpd.loc* >/dev/null 2>&1
51         else
52                 msg_not_running httpd
53                 exit 1
54         fi
55         ;;
56   status)
57         status httpd
58         /usr/sbin/httpd -S
59         exit $?
60         ;;
61   restart)
62         $0 stop
63         $0 start
64         ;;
65    reload)
66         msg_reloading httpd
67         killproc httpd -HUP
68         RETVAL=$?
69         ;;
70   *)
71         msg_usage "$0 {start|stop|restart|reload|status}"
72         exit 1
73         ;;
74 esac
75
76 exit $RETVAL
This page took 0.180351 seconds and 4 git commands to generate.