diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2016-01-29 05:42:19 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2016-01-29 05:42:19 -0500 |
commit | 1a9ede7eaa41f510c0f643de14ff712cce564c18 (patch) | |
tree | d7f34b02a2cfa12755e10892a1bbb70463bf2e17 /www-servers/varnish/files | |
parent | Merge remote-tracking branch 'remotes/sbraz/fail2ban' (diff) | |
download | gentoo-1a9ede7eaa41f510c0f643de14ff712cce564c18.tar.gz gentoo-1a9ede7eaa41f510c0f643de14ff712cce564c18.tar.bz2 gentoo-1a9ede7eaa41f510c0f643de14ff712cce564c18.zip |
www-servers/varnish: version bump to 4.1.1, fix bug #567756
Package-Manager: portage-2.2.26
Diffstat (limited to 'www-servers/varnish/files')
-rw-r--r-- | www-servers/varnish/files/varnishd.confd-r4 | 18 | ||||
-rw-r--r-- | www-servers/varnish/files/varnishd.initd-r4 | 78 |
2 files changed, 96 insertions, 0 deletions
diff --git a/www-servers/varnish/files/varnishd.confd-r4 b/www-servers/varnish/files/varnishd.confd-r4 new file mode 100644 index 000000000000..1a18b648541a --- /dev/null +++ b/www-servers/varnish/files/varnishd.confd-r4 @@ -0,0 +1,18 @@ +# /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" + +# 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" diff --git a/www-servers/varnish/files/varnishd.initd-r4 b/www-servers/varnish/files/varnishd.initd-r4 new file mode 100644 index 000000000000..b0ec918bb7ad --- /dev/null +++ b/www-servers/varnish/files/varnishd.initd-r4 @@ -0,0 +1,78 @@ +#!/sbin/runscript +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +VARNISHD_PID=${VARNISHD_PID:-/run/${SVCNAME}.pid} +CONFIGFILES="${CONFIGFILE:-/etc/varnish/default.vcl}" + +command="${VARNISHD:-/usr/sbin/varnishd}" +command_args="-j unix,user=varnish -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 +} |