diff options
author | Ermal <eri@pfsense.org> | 2013-08-02 14:04:10 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2013-08-02 14:04:10 +0000 |
commit | 746f0afb00db6ddd5445d39a5fbc42690fcaad13 (patch) | |
tree | 48d70674b3da5e822f7f4814d2daab0217892c8d /etc/inc/gwlb.inc | |
parent | ab9dc5be75ad873e0d28cec3671ca7393d238a9b (diff) | |
download | pfsense-746f0afb00db6ddd5445d39a5fbc42690fcaad13.zip pfsense-746f0afb00db6ddd5445d39a5fbc42690fcaad13.tar.gz |
Reload apinger now that we can rather than restarting. Related to Ticket #3119
Diffstat (limited to 'etc/inc/gwlb.inc')
-rw-r--r-- | etc/inc/gwlb.inc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 3f9e1fe..17a0d20 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -240,7 +240,6 @@ EOD; @file_put_contents("{$g['varetc_path']}/apinger.conf", $apingerconfig); unset($apingerconfig); - killbypid("{$g['varrun_path']}/apinger.pid"); if (is_dir("{$g['tmp_path']}")) chmod("{$g['tmp_path']}", 01777); if (!is_dir("{$g['vardb_path']}/rrd")) @@ -248,12 +247,16 @@ EOD; @chown("{$g['vardb_path']}/rrd", "nobody"); - /* start a new apinger process */ - @unlink("{$g['varrun_path']}/apinger.status"); - sleep(1); - mwexec_bg("/usr/local/sbin/apinger -c {$g['varetc_path']}/apinger.conf"); - sleep(1); - sigkillbypid("{$g['varrun_path']}/apinger.pid", "USR1"); + if (isvalidpid("{$g['varrun_path']}/apinger.pid")) + sigkillbypid("{$g['varrun_path']}/apinger.pid", "HUP"); + else { + /* start a new apinger process */ + @unlink("{$g['varrun_path']}/apinger.status"); + sleep(1); + mwexec_bg("/usr/local/sbin/apinger -c {$g['varetc_path']}/apinger.conf"); + sleep(1); + sigkillbypid("{$g['varrun_path']}/apinger.pid", "USR1"); + } return 0; } |