idl0r 14/05/22 20:23:48
Added: varnishlog.initd varnishncsa.confd
varnishd.confd-r3 varnishlog.confd
varnishncsa.initd varnishd.initd-r3
varnishd.logrotate-r2
Log:
Revbump. Major changes
Logdir no longer world readable - bug 458888
varnishd, varnishncsa and varnishlog have been split into separate init
scripts, also fixes bug 480252
Run Varnish as user (varnish/varnish)
Check the VCL for errors before stopping varnishd when doing a restart
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key
B427ABC8)
Revision Changes Path
1.1 www-servers/varnish/files/varnishlog.initd
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishlog.initd?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishlog.initd?rev=1.1&content-type=text/plain
Index: varnishlog.initd
===================================================================
#!/sbin/runscript
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-servers/varnish/files/varnishlog.initd,v
1.1 2014/05/22 20:23:48 idl0r Exp $
VARNISHLOG_PID=${VARNISHLOG_PID:-/run/${SVCNAME}.pid}
command="${VARNISHLOG:-/usr/bin/varnishlog}"
command_args="-D -P ${VARNISHLOG_PID} ${VARNISHLOG_OPTS}"
pidfile="${VARNISHLOG_PID}"
extra_started_commands="reload rotate flush"
description_rotate="Rotate the log file"
description_flush="Flush any outstanding transactions"
rotate() {
ebegin "Rotating log file"
start-stop-daemon -p ${VARNISHLOG_PID} -s SIGHUP
eend $?
}
flush() {
ebegin "Flushing any outstanding transactions"
start-stop-daemon -p ${VARNISHLOG_PID} -s SIGUSR1
eend $?
}
reload() {
flush
rotate
}
1.1 www-servers/varnish/files/varnishncsa.confd
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishncsa.confd?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishncsa.confd?rev=1.1&content-type=text/plain
Index: varnishncsa.confd
===================================================================
# /etc/conf.d/varnishncsa
VARNISHNCSA_OPTS="-a -w /var/log/varnish/${SVCNAME}.log"
1.1 www-servers/varnish/files/varnishd.confd-r3
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishd.confd-r3?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishd.confd-r3?rev=1.1&content-type=text/plain
Index: varnishd.confd-r3
===================================================================
# /etc/conf.d/varnishd
VARNISHD="/usr/sbin/varnishd"
VARNISHADM="/usr/bin/varnishadm"
#CONFIGFILES="/etc/varnish/${SVCNAME}.vcl"
CONFIGFILE="/etc/varnish/default.vcl"
# Listen on 127.0.0.1:8080 and connect to backend 127.0.0.1:80
#VARNISHD_OPTS="-a 127.0.0.1:8080 -a 127.0.0.1:8080"
# Alternatively, don't listen to a backend
VARNISHD_OPTS="-a 127.0.0.1:8080"
# User/Group
VARNISHD_OPTS="${VARNISHD_OPTS} -u varnish -g varnish"
# You may need to increase the number of open files (-n)
# and the maximum amount off locked memory (-l)
# See bug #459142
#rc_ulimit="-n 32786 -l 82000"
1.1 www-servers/varnish/files/varnishlog.confd
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishlog.confd?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishlog.confd?rev=1.1&content-type=text/plain
Index: varnishlog.confd
===================================================================
# /etc/conf.d/varnishlog
VARNISHLOG_OPTS="-a -w /var/log/varnish/varnishlog.log"
1.1 www-servers/varnish/files/varnishncsa.initd
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishncsa.initd?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishncsa.initd?rev=1.1&content-type=text/plain
Index: varnishncsa.initd
===================================================================
#!/sbin/runscript
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header:
/var/cvsroot/gentoo-x86/www-servers/varnish/files/varnishncsa.initd,v 1.1
2014/05/22 20:23:48 idl0r Exp $
VARNISHNCSA_PID=${VARNISHNCSA_PID:-/run/${SVCNAME}.pid}
command="${VARNISHNCSA:-/usr/bin/varnishncsa}"
command_args="-D -P ${VARNISHNCSA_PID} ${VARNISHNCSA_OPTS}"
pidfile="${VARNISHNCSA_PID}"
extra_started_commands="reload rotate flush"
description_rotate="Rotate the log file"
description_flush="Flush any outstanding transactions"
rotate() {
ebegin "Rotating log file"
start-stop-daemon -p ${VARNISHNCSA_PID} -s SIGHUP
eend $?
}
flush() {
ebegin "Flushing any outstanding transactions"
start-stop-daemon -p ${VARNISHNCSA_PID} -s SIGUSR1
eend $?
}
reload() {
flush
rotate
}
1.1 www-servers/varnish/files/varnishd.initd-r3
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishd.initd-r3?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishd.initd-r3?rev=1.1&content-type=text/plain
Index: varnishd.initd-r3
===================================================================
#!/sbin/runscript
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header:
/var/cvsroot/gentoo-x86/www-servers/varnish/files/varnishd.initd-r3,v 1.1
2014/05/22 20:23:48 idl0r Exp $
VARNISHD_PID=${VARNISHD_PID:-/run/${SVCNAME}.pid}
CONFIGFILES="${CONFIGFILE:-/etc/varnish/default.vcl}"
command="${VARNISHD:-/usr/sbin/varnishd}"
command_args="-P ${VARNISHD_PID} -f ${CONFIGFILE} ${VARNISHD_OPTS}"
pidfile="${VARNISHD_PID}"
extra_commands="configtest"
extra_started_commands="reload"
description_configtest="Run syntax tests for configuration files."
description_reload="Reloads the configuration."
depend() {
need net
}
configtest() {
ebegin "Checking ${SVCNAME} configuration"
checkconfig
eend $?
}
checkconfig() {
${VARNISHD} -C -f ${CONFIGFILE} >/dev/null 2>&1
ret=$?
if [ $ret -ne 0 ]; then
eerror "${SVCNAME} has detected an error in your setup:"
${VARNISHD} -C -f ${CONFIGFILE}
fi
return $ret
}
start_pre() {
checkconfig || return 1
}
stop_pre() {
if [ "${RC_CMD}" = "restart" ]; then
checkconfig || return 1
fi
}
reload() {
checkconfig || return 1
ebegin "Reloading varnish"
$VARNISHADM vcl.list >/dev/null 2>&1
ret=$?
if [ $ret -ne 0 ]; then
eerror "${SVCNAME} cannot list configuration"
return 1
fi
new_config="reload_$(date +%FT%H:%M:%S)"
$VARNISHADM vcl.load $new_config $CONFIGFILE >/dev/null 2>&1
ret=$?
if [ $ret -ne 0 ]; then
eerror "${SVCNAME} cannot load configuration"
return 1
fi
$VARNISHADM vcl.use $new_config >/dev/null 2>&1
ret=$?
if [ $ret -ne 0 ]; then
eerror "${SVCNAME} cannot switch configuration"
return 1
fi
eend 0
}
1.1 www-servers/varnish/files/varnishd.logrotate-r2
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishd.logrotate-r2?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishd.logrotate-r2?rev=1.1&content-type=text/plain
Index: varnishd.logrotate-r2
===================================================================
/var/log/varnish/varnishncsa.log {
daily
rotate 31
copytruncate
dateext
dateyesterday
delaycompress
compress
notifempty
missingok
prerotate
/etc/init.d/varnishncsa -q status && /etc/init.d/varnishncsa -q
flush
endscript
}
/var/log/varnish/varnishlog.log {
daily
rotate 31
copytruncate
dateext
dateyesterday
delaycompress
compress
notifempty
missingok
prerotate
/etc/init.d/varnishlog -q status && /etc/init.d/varnishlog -q
flush
endscript
}