From b1bd21194433ce964c9af23979f69ab06e1d5319 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Sun, 11 Jul 2010 21:22:54 -0400 Subject: only reload if relayd is already running, don't kill and then start it --- etc/inc/vslb.inc | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'etc/inc') diff --git a/etc/inc/vslb.inc b/etc/inc/vslb.inc index bb92e19..dcf30cf 100644 --- a/etc/inc/vslb.inc +++ b/etc/inc/vslb.inc @@ -261,16 +261,26 @@ function relayd_configure() { fclose($fd); if (is_process_running('relayd')) { - /* - * 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'); - } - if (! empty($vs_a)) { - mwexec("/usr/local/sbin/relayd -f {$g['varetc_path']}/relayd.conf"); + if (! empty($vs_a)) { + // it's running and there is a config, just reload + mwexec("/usr/local/bin/relayctl reload"); + } else { + /* + * XXX: Something breaks our control connection with relayd + * and makes 'relayctl stop' not work + * rule reloads are the current suspect + * mwexec('/usr/local/bin/relayctl stop'); + * returns "command failed" + */ + mwexec('pkill relayd'); + } + } else { + if (! empty($vs_a)) { + // not running and there is a config, start it + mwexec("/usr/local/sbin/relayd -f {$g['varetc_path']}/relayd.conf"); + } } + } ?> \ No newline at end of file -- cgit v1.1