{ $srvtxt }\n"; /* Index by name for easier fetching when we loop through the virtual servers */ $pools[$pool_a[$i]['name']] = $pool_a[$i]; } } } if(is_array($vs_a)) { for ($i = 0; isset($vs_a[$i]); $i++) { $conf .= "redirect \"{$vs_a[$i]['name']}\" {\n"; $conf .= " listen on {$vs_a[$i]['ipaddr']} port {$vs_a[$i]['port']}\n"; $conf .= " forward to <{$vs_a[$i]['pool']}> port {$pools[$vs_a[$i]['pool']]['port']} check tcp timeout 1000\n"; /* XXX - this needs to use the backup pool aka sitedown - but that isn't converted yet */ if (isset($vs_a[$i]['sitedown']) && $vs_a[$i]['sitedown'] != "") $conf .= " forward to <{$vs_a[$i]['sitedown']}> port {$pools[$vs_a[$i]['pool']]['port']} check tcp timeout 1000\n"; $conf .= "}\n"; } } fwrite($fd, $conf); fclose($fd); if (is_process_running('relayd: parent')) { /* * XXX: Something breaks our control connection with relayd and makes relayctl stop working * rule reloads are the current suspect * mwexec('/usr/local/bin/relayctl stop'); */ mwexec('pkill relayd'); } mwexec("/usr/local/sbin/relayd -f {$g['varetc_path']}/relayd.conf"); } ?>