From 098947479721ab84452799a0a515a234b11af9de Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Wed, 24 Aug 2005 21:14:25 +0000 Subject: Allow SLBD to start. --- etc/inc/vslb.inc | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'etc') diff --git a/etc/inc/vslb.inc b/etc/inc/vslb.inc index 4a329fe..e341560 100644 --- a/etc/inc/vslb.inc +++ b/etc/inc/vslb.inc @@ -35,14 +35,11 @@ require_once("notices.inc"); function slbd_configure() { global $config, $g; - - /* no need to go further if we don't have any load balance stuff */ - if ((!is_array($config['load_balancer'])) || (!is_array($config['load_balancer']['pool']))) - return; - + $a_vs = &$config['load_balancer']['virtual_server']; $a_pool = &$config['load_balancer']['pool']; + $should_start=0; $fd = fopen("{$g['varetc_path']}/slbd.conf", "w"); @@ -78,12 +75,19 @@ function slbd_configure() { } $slbdconf .= "\t:tcppoll:send=:expect=:\n"; + + $should_start=1; + } + + if($should_start == 1) { + fwrite($fd, $slbdconf); + fclose($fd); + mwexec("/usr/bin/pkill -9 slbd"); + /* startup slbd pointing it's config at /var/etc/slbd.conf with a polling interval of 5 seconds */ + mwexec("/usr/local/sbin/slbd -c{$g['varetc_path']}/slbd.conf -r5000"); + } else { + fclose($fd); } - fwrite($fd, $slbdconf); - fclose($fd); - mwexec("/usr/bin/pkill -9 slbd"); - /* startup slbd pointing it's config at /var/etc/slbd.conf with a polling interval of 5 seconds */ - mwexec("/usr/local/sbin/slbd -c{$g['varetc_path']}/slbd.conf -r5000"); } -?> +?> \ No newline at end of file -- cgit v1.1