summaryrefslogtreecommitdiff
path: root/www/apache22/files/apache.sh
blob: ecc4de893edfc776f37ba238e7b8c588a84ee1fa (plain) (blame)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/sh
#
# $FreeBSD: /tmp/pcvs/ports/www/apache22/files/Attic/apache.sh,v 1.7 2004-12-11 18:06:04 clement Exp $
#

# PROVIDE: apache21
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: FreeBSD shutdown

#
# Add the following lines to /etc/rc.conf to enable apache21:
# apache21_enable (bool):      Set to "NO" by default.
#                             Set it to "YES" to enable apache21
# apache21ssl_enable (bool):   Set to "NO" by default.
#                             Set it to "YES" to start apache with SSL   
#                             (if <IfDefined SSL> exists in httpd.conf)
# apache21limits_enable (bool):Set to "NO" by default.
#                             Set it to yes to run `limits $limits_args`
#                             just before apache starts.
# apache21_flags (str):        Set to "" by default.
#                             Extra flags passed to start command.
# apache21limits_args (str):   Default to "-e -C daemon"
#                             Arguments of pre-start limits run.
#
. %%RC_SUBR%%

name="apache21"
rcvar=`set_rcvar`

start_precmd="apache21_precmd"
restart_precmd="apache21_checkconfig"
reload_precmd="apache21_checkconfig"
command="%%PREFIX%%/sbin/httpd"
pidfile="/var/run/httpd.pid"
required_files=%%PREFIX%%/etc/apache21/httpd.conf

[ -z "$apache21_enable" ]       && apache21_enable="NO"
[ -z "$apache21ssl_enable" ]    && apache21ssl_enable="NO"
[ -z "$apache21_flags" ]        && apache21_flags=""
[ -z "$apache21limits_enable" ] && apache21limits_enable="NO"
[ -z "$apache21limits_args" ]   && apache21limits_args="-e -C daemon"

load_rc_config $name

checkyesno apache21ssl_enable && \
			apache21_flags="-DSSL $apache21_flags"

apache21_checkconfig()
{
	echo "Performing sanity check on apache21 configuration:"
	${command} -t
}

apache21_precmd() 
{
	if test -f %%PREFIX%%/sbin/envvars
	then
		. %%PREFIX%%/sbin/envvars
	fi
	if checkyesno apache21limits_enable
	then
		eval `/usr/bin/limits ${apache21limits_args}` 2>/dev/null
	else
		return 0
        fi

}

sig_reload=SIGUSR1

extra_commands="reload"
run_rc_command "$1"