summaryrefslogtreecommitdiff
path: root/www/varnish2/files/varnishd.in
blob: 90195b126d5e589bf53deee1c5c10d545b4312eb (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
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: varnishd
# REQUIRE: DAEMON
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf to enable varnishd:
#
#varnishd_enable="YES"
#
# Configuration variables and their default values:
#
#varnishd_listen=":6081"
#varnishd_config="%%PREFIX%%/etc/varnish/default.vcl"
#varnishd_telnet="localhost:6082"
#varnishd_storage="file,/tmp,50%"
#varnishd_user="www"
#varnishd_group="www"
#varnishd_flags="-P ${pidfile} -a ${varnishd_listen} -f ${varnishd_config} -T ${varnishd_telnet} -s ${varnishd_storage} -u ${varnishd_user} -g ${varnishd_group}"
#
# See varnishd(1) for a detailed overview of command-line options.
#

. %%RC_SUBR%%

name=varnishd
rcvar=`set_rcvar`

command="%%PREFIX%%/sbin/varnishd"
pidfile="/var/run/${name}.pid"

# read configuration and set defaults
load_rc_config ${name}
: ${varnishd_enable="NO"}
: ${varnishd_listen=":6081"}
: ${varnishd_config="%%PREFIX%%/etc/varnish/default.vcl"}
: ${varnishd_telnet="localhost:6082"}
: ${varnishd_storage="file,/tmp,50%"}
: ${varnishd_user="www"}
: ${varnishd_group="www"}
: ${varnishd_flags="-P ${pidfile} -a ${varnishd_listen} -f ${varnishd_config} -T ${varnishd_telnet} -s ${varnishd_storage} -u ${varnishd_user} -g ${varnishd_group}"}

# If we leave these set, rc.subr will su to them before starting
# varnishd, which is not what we want.
unset varnishd_user
unset varnishd_group

run_rc_command "$1"