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

# PROVIDE: varnishlog
# REQUIRE: DAEMON
# KEYWORD: shutdown

#
# Add the following line to /etc/rc.conf to enable varnishlog:
#
# varnishlog_enable="YES"
#
# Configuration variables and their default values:
#
# varnishlog_pidfile - full path to the PID file.
#	default: "/var/run/varnishlog.pid"
#
# varnishlog_file - full path to the log file.
#	default: "/var/log/varnish.log"
#
# varnishlog_flags - command line arguments.
#	default: "-D -P ${varnishlog_pidfile} -a -w ${varnishlog_file}"
#
# Add the following line to /etc/newsyslog.conf to rotate the log file
# once a day:
#
# /var/log/varnish.log 640 7 * @T00 JB /var/run/varnishlog.pid
#
# See varnishlog(1) for a detailed overview of command-line options.
#

. /etc/rc.subr

name="varnishlog"
rcvar=`set_rcvar`

command="%%PREFIX%%/bin/${name}"

# read configuration and set defaults
load_rc_config ${name}
: ${varnishlog_enable:="NO"}
: ${varnishlog_pidfile:="/var/run/${name}.pid"}
: ${varnishlog_file:="/var/log/varnish.log"}
: ${varnishlog_flags:="-P ${varnishlog_pidfile} -D -a -w ${varnishlog_file}"}

pidfile=${varnishlog_pidfile}
run_rc_command "$1"