]> git.pld-linux.org Git - packages/apache.git/blob - apache1.init
- taken apache1-less-libs.patch for Ra
[packages/apache.git] / apache1.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:  apache
9 # pidfile:      /var/run/apache.pid
10 # config:       /etc/apache/apache.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/apache1 ] && . /etc/sysconfig/apache1
21
22 # Check that networking is up.
23 if is_yes "${NETWORKING}"; then
24         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
25                 # nls "ERROR: Networking is down. %s can't be run." <service>
26                 msg_network_down apache
27                 exit 1
28         fi
29 else
30         exit 0
31 fi
32
33 if is_no "${IPV6_NETWORKING}"; then
34         HTTPD_OPTS="$HTTPD_OPTS -4"
35 fi
36
37 RETVAL=0
38 # See how we were called.
39 case "$1" in
40   start)
41         # Check if the service is already running?
42         if [ ! -f /var/lock/subsys/apache ]; then
43                 msg_starting apache
44                 daemon apache $HTTPD_OPTS
45                 RETVAL=$?
46                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/apache
47         else
48                 msg_already_running apache
49         fi
50         ;;
51   stop)
52         # Stop daemons.
53         if [ -f /var/lock/subsys/apache ]; then
54                 msg_stopping apache
55                 killproc apache
56                 rm -f /var/lock/subsys/apache /var/run/.pid /var/run/apache.loc* >/dev/null 2>&1
57         else
58                 msg_not_running apache
59         fi
60         ;;
61   status)
62         status apache
63         RETVAL=$?
64         /usr/sbin/apache -S
65         ;;
66   restart)
67         $0 stop
68         $0 start
69         exit $?
70         ;;
71   reload|force-reload)
72         if [ -f /var/lock/subsys/apache ]; then
73                 msg_reloading apache
74                 killproc apache -HUP
75                 RETVAL=$?
76         else
77                 msg_not_running apache >&2
78                 RETVAL=7
79         fi
80         ;;
81   graceful)
82         if [ -f /var/lock/subsys/apache ]; then
83                 msg_reloading apache
84                 killproc apache -USR1
85                 RETVAL=$?
86         else
87                 msg_not_running apache >&2
88                 RETVAL=7
89         fi
90         ;;
91   *)
92         msg_usage "$0 {start|stop|restart|reload|force-reload|graceful|status}"
93         exit 3
94         ;;
95 esac
96
97 exit $RETVAL
This page took 0.053198 seconds and 3 git commands to generate.