summaryrefslogtreecommitdiff
blob: a4a6c40adea0af1ffdda37e455b32951a8edd091 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/sbin/runscript
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-www/apache/files/apache.rc6,v 1.8 2002/11/02 08:18:52 woodchip Exp $

depend() {
	need net
	use mysql dns logger
}

start() {
	ebegin "Starting apache"
	start-stop-daemon -o --quiet --start --startas /usr/sbin/apache \
		--pidfile /var/run/apache.pid -- ${APACHE_OPTS}
	eend $?
}

stop() {
	ebegin "Stopping apache"
	/usr/sbin/apachectl stop &>/dev/null
	start-stop-daemon -o --quiet --stop --pidfile /var/run/apache.pid
	eend $?
}

svc_restart() {
	ebegin "Gracefully restarting apache"
	/usr/sbin/apache -t ${APACHE_OPTS} &>/dev/null

	if [ "$?" != "0" ]; then
		svc_stop
		eend 1 "Apache configuration error"
	else
		killall -USR1 apache &> /dev/null
		svc_start &>/dev/null
		eend $?
	fi
}