]>
Commit | Line | Data |
---|---|---|
8faab90e | 1 | #!/bin/sh |
58f9559b | 2 | # |
34c86420 | 3 | # apache Apache Web Server |
58f9559b | 4 | # |
34c86420 | 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 | |
58f9559b AF |
16 | . /etc/rc.d/init.d/functions |
17 | ||
34c86420 | 18 | # Get network config |
19 | . /etc/sysconfig/network | |
20 | ||
21 | # Get service config | |
22 | [ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache | |
23 | ||
58f9559b | 24 | # Check that networking is up. |
a4aad8e2 | 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 | |
036261c0 | 29 | fi |
a4aad8e2 | 30 | |
58f9559b AF |
31 | |
32 | # See how we were called. | |
33 | case "$1" in | |
34 | start) | |
34c86420 | 35 | # Check if the service is already running? |
a4aad8e2 | 36 | if [ ! -f /var/lock/subsys/httpd ]; then |
37 | msg_starting httpd | |
34c86420 | 38 | daemon httpd |
a4aad8e2 | 39 | RETVAL=$? |
40 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/httpd | |
34c86420 | 41 | else |
a4aad8e2 | 42 | msg_Already_Running httpd |
43 | exit 1 | |
34c86420 | 44 | fi |
58f9559b AF |
45 | ;; |
46 | stop) | |
a4aad8e2 | 47 | # Stop daemons. |
48 | if [ -f /var/lock/subsys/httpd ]; then | |
49 | msg_stopping httpd | |
50 | killproc httpd | |
51 | rm -f /var/lock/subsys/httpd /var/run/httpd.pid /var/run/httpd.loc* >/dev/null 2>&1 | |
52 | else | |
53 | msg_Not_Running httpd | |
54 | exit 1 | |
55 | fi | |
58f9559b AF |
56 | ;; |
57 | status) | |
58 | status httpd | |
3226fe05 | 59 | /usr/sbin/httpd -S |
a4aad8e2 | 60 | exit $? |
58f9559b | 61 | ;; |
34c86420 | 62 | restart|reload) |
58f9559b AF |
63 | $0 stop |
64 | $0 start | |
65 | ;; | |
66 | *) | |
a4aad8e2 | 67 | msg_Usage "$0 {start|stop|restart|status}" |
58f9559b AF |
68 | exit 1 |
69 | ;; | |
70 | esac | |
71 | ||
a4aad8e2 | 72 | exit $RETVAL |