]> git.pld-linux.org Git - packages/apache.git/blame - apache.init
- fixed %%lang
[packages/apache.git] / apache.init
CommitLineData
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 25if 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 29fi
1f86fa83 30
8409de7b 31if is_no "${IPV6_NETWORKING}"; then
1f86fa83 32 HTTPD_OPTS="$HTTPD_OPTS -4"
33fi
58f9559b
AF
34
35# See how we were called.
36case "$1" in
37 start)
34c86420 38 # Check if the service is already running?
a4aad8e2 39 if [ ! -f /var/lock/subsys/httpd ]; then
40 msg_starting httpd
1f86fa83 41 daemon httpd $HTTPD_OPTS
a4aad8e2 42 RETVAL=$?
43 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/httpd
34c86420 44 else
c1db4afe 45 msg_already_running httpd
a4aad8e2 46 exit 1
34c86420 47 fi
58f9559b
AF
48 ;;
49 stop)
a4aad8e2 50 # Stop daemons.
51 if [ -f /var/lock/subsys/httpd ]; then
52 msg_stopping httpd
53 killproc httpd
54 rm -f /var/lock/subsys/httpd /var/run/httpd.pid /var/run/httpd.loc* >/dev/null 2>&1
55 else
c1db4afe 56 msg_not_running httpd
a4aad8e2 57 exit 1
58 fi
58f9559b
AF
59 ;;
60 status)
61 status httpd
3226fe05 62 /usr/sbin/httpd -S
a4aad8e2 63 exit $?
58f9559b 64 ;;
34c86420 65 restart|reload)
58f9559b
AF
66 $0 stop
67 $0 start
68 ;;
69 *)
c1db4afe 70 msg_usage "$0 {start|stop|restart|status}"
58f9559b
AF
71 exit 1
72 ;;
73esac
74
a4aad8e2 75exit $RETVAL
This page took 0.306646 seconds and 4 git commands to generate.