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