From f78a59ea47984775f69368f59d88012e521f3653 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 27 Apr 2010 21:21:51 -0400 Subject: Eliminate a case where a LB Director and a Backend may have the same name by appending BACKEND to the end of all backend names --- config/varnish64/varnish.inc | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'config/varnish64/varnish.inc') diff --git a/config/varnish64/varnish.inc b/config/varnish64/varnish.inc index e098e20a..7535b1bb 100644 --- a/config/varnish64/varnish.inc +++ b/config/varnish64/varnish.inc @@ -31,6 +31,18 @@ */ /* ========================================================================== */ +function varnish_install() { + create_varnish_rcd_file(); +} + +function varnish_deinstall() { + create_varnish_rcd_file(); +} + +function varnish_start() { + mwexec("/usr/local/etc/rc.d/varnish.sh"); +} + /* Return true if a backend is in use */ function is_varnish_backend_in_use($backendname) { global $g, $config; @@ -75,7 +87,7 @@ EOAU; $urlmappings .= "else "; $urlmappings .= <</dev/null killall varnishd 2>/dev/null sleep 1 +/usr/bin/env \ +PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ +/usr/local/bin/php -q -d auto_prepend_file=config.inc < +ENDOFF /usr/local/sbin/varnishd \ {$listeningport} \ -f /var/etc/default.vcl \ @@ -133,6 +155,7 @@ EOF; function get_backend_config_txt() { global $config, $g; + $backends_used = array(); if($config['installedpackages']['varnishbackends']['config'] != "") { foreach($config['installedpackages']['varnishbackends']['config'] as $backend) { if($backend['connect_timeout']) @@ -168,8 +191,9 @@ function get_backend_config_txt() { else $probe_threshold = "5"; if(is_varnish_backend_in_use($backend['backendname'])) - $backends .= <<