]>
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 | |
40350f98 MM |
10 | # config: /etc/httpd/conf/access.conf |
11 | # config: /etc/httpd/conf/httpd.conf | |
12 | # config: /etc/httpd/conf/srm.conf | |
34c86420 | 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> | |
c1db4afe | 27 | msg_network_down httpd |
a4aad8e2 | 28 | exit 1 |
036261c0 | 29 | fi |
1f86fa83 | 30 | |
58f9559b AF |
31 | # See how we were called. |
32 | case "$1" in | |
33 | start) | |
34c86420 | 34 | # Check if the service is already running? |
a4aad8e2 | 35 | if [ ! -f /var/lock/subsys/httpd ]; then |
36 | msg_starting httpd | |
1f86fa83 | 37 | daemon httpd $HTTPD_OPTS |
a4aad8e2 | 38 | RETVAL=$? |
39 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/httpd | |
34c86420 | 40 | else |
c1db4afe | 41 | msg_already_running httpd |
a4aad8e2 | 42 | exit 1 |
34c86420 | 43 | fi |
58f9559b AF |
44 | ;; |
45 | stop) | |
a4aad8e2 | 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 | |
c1db4afe | 52 | msg_not_running httpd |
a4aad8e2 | 53 | exit 1 |
54 | fi | |
58f9559b AF |
55 | ;; |
56 | status) | |
57 | status httpd | |
3226fe05 | 58 | /usr/sbin/httpd -S |
a4aad8e2 | 59 | exit $? |
58f9559b | 60 | ;; |
40350f98 | 61 | restart) |
58f9559b AF |
62 | $0 stop |
63 | $0 start | |
64 | ;; | |
40350f98 MM |
65 | reload) |
66 | msg_reloading httpd | |
67 | killproc httpd -HUP | |
68 | RETVAL=$? | |
69 | ;; | |
58f9559b | 70 | *) |
40350f98 | 71 | msg_usage "$0 {start|stop|restart|reload|status}" |
58f9559b AF |
72 | exit 1 |
73 | ;; | |
74 | esac | |
75 | ||
a4aad8e2 | 76 | exit $RETVAL |