aboutsummaryrefslogtreecommitdiff
path: root/www/apache13-ssl/files/apache.in
blob: 171848e4879a54f74498b837700a4d5191414869 (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
#!/bin/sh
#
# $FreeBSD$
# renamed from ports/www/apache13-ssl/files/apache.sh,v 1.2 2006/02/20 20:47:46 dougb Exp
#

# PROVIDE: apache
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf to enable apache:
# apache_enable (bool):      Set to "NO" by default.
#                             Set it to "YES" to enable apache
# apachelimits_enable (bool):Set to "NO" by default.
#                             Set it to yes to run `limits $limits_args`
#                             just before apache starts.
# apache_flags (str):        Set to "" by default.
#                             Extra flags passed to start command.
# apachelimits_args (str):   Default to "-e -C daemon"
#                             Arguments of pre-start limits run.
#
. %%RC_SUBR%%

name="apache"
rcvar=`set_rcvar`

start_precmd="apache_precmd"
restart_precmd="apache_checkconfig"
reload_precmd="apache_checkconfig"
command="%%PREFIX%%/sbin/httpsd"
pidfile="/var/run/httpsd.pid"
required_files=%%PREFIX%%/etc/apache/httpsd.conf

load_rc_config $name

[ -z "$apache_enable" ]       && apache_enable="NO"
[ -z "$apachelimits_enable" ] && apachelimits_enable="NO"
[ -z "$apachelimits_args" ]   && apachelimits_args="-e -C daemon"

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

apache_precmd() 
{
	if checkyesno apachelimits_enable
	then
		eval `/usr/bin/limits ${apachelimits_args}` 2>/dev/null
	else
		return 0
        fi

}

sig_reload=SIGUSR1

extra_commands="reload"
run_rc_command "$1"