]> git.pld-linux.org Git - packages/apache1.git/blame - apache1.init
- updated
[packages/apache1.git] / apache1.init
CommitLineData
0f05f0de
JB
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/httpd.conf
11
12
13# Source function library
14. /etc/rc.d/init.d/functions
15
16# Get network config
17. /etc/sysconfig/network
18
19# Get service config
20[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
21
22# Check that networking is up.
23if is_no "${NETWORKING}"; then
24 # nls "ERROR: Networking is down. %s can't be run." <service>
25 msg_network_down httpd
26 exit 1
27fi
28
29if is_no "${IPV6_NETWORKING}"; then
30 HTTPD_OPTS="$HTTPD_OPTS -4"
31fi
32
33# See how we were called.
34case "$1" in
35 start)
36 # Check if the service is already running?
37 if [ ! -f /var/lock/subsys/httpd ]; then
38 msg_starting httpd
39 daemon httpd $HTTPD_OPTS
40 RETVAL=$?
41 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/httpd
42 else
43 msg_already_running httpd
44 exit 1
45 fi
46 ;;
47 stop)
48 # Stop daemons.
49 if [ -f /var/lock/subsys/httpd ]; then
50 msg_stopping httpd
51 killproc httpd
52 rm -f /var/lock/subsys/httpd /var/run/httpd.pid /var/run/httpd.loc* >/dev/null 2>&1
53 else
54 msg_not_running httpd
55 exit 1
56 fi
57 ;;
58 status)
59 status httpd
60 /usr/sbin/httpd -S
61 exit $?
62 ;;
63 restart|reload)
64 $0 stop
65 $0 start
66 ;;
67 *)
626711b4 68 msg_usage "$0 {start|stop|restart|reload|status}"
0f05f0de
JB
69 exit 1
70 ;;
71esac
72
73exit $RETVAL
This page took 0.081198 seconds and 4 git commands to generate.