-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
haproxy-devel, Asynchronous XMLRPC sync, and fixed issues due to chan…
…ged paths. pkg v 0.38
- Loading branch information
Showing
8 changed files
with
38 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
/* | ||
haproxy.inc | ||
Copyright (C) 2013-2015 PiBa-NL | ||
Copyright (C) 2013-2016 PiBa-NL | ||
Copyright (C) 2009 Scott Ullrich <[email protected]> | ||
Copyright (C) 2008 Remco Hoef | ||
All rights reserved. | ||
|
@@ -1307,10 +1307,13 @@ function haproxy_check_and_run(&$messages, $reload) { | |
} | ||
$ok = strstr($retval, "Configuration file is valid"); | ||
if ($ok && $reload) { | ||
global $haproxy_run_message; | ||
global $haproxy_run_message, $config; | ||
rmdir_recursive($testpath); | ||
$ok = haproxy_check_run(1) == 0; | ||
$messages = $haproxy_run_message; | ||
if ($ok && isset($config['installedpackages']['haproxy']['enablesync'])) { | ||
mwexec_bg("/usr/local/pkg/haproxy/haproxy_sync.sh"); | ||
} | ||
} | ||
return $ok; | ||
} | ||
|
@@ -2031,11 +2034,6 @@ function haproxy_writeconf($configpath) { | |
if ($input_errors) { | ||
require_once("guiconfig.inc"); | ||
print_input_errors($input_errors); | ||
} else { | ||
// Only sync to xmlrpc backup machine if no errors are found in config | ||
if (isset($config['installedpackages']['haproxy']['enablesync'])) { | ||
haproxy_do_xmlrpc_sync(); | ||
} | ||
} | ||
} | ||
|
||
|
@@ -2403,7 +2401,7 @@ function haproxy_do_xmlrpc_sync() { | |
$syncinfo = array(); | ||
$syncinfo['sync_logname'] = "HAProxy"; | ||
$syncinfo['data'] = haproxy_xmlrpc_sync_prepare_config(); | ||
$syncinfo['sync_include'] = "/usr/local/pkg/haproxy.inc"; | ||
$syncinfo['sync_include'] = "/usr/local/pkg/haproxy/haproxy.inc"; | ||
$syncinfo['sync_done_execute'] = "haproxy_xmlrpc_sync_configure"; | ||
xmlrpc_sync_execute($syncinfo); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
net/pfSense-pkg-haproxy-devel/files/usr/local/pkg/haproxy/haproxy_sync.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/local/bin/php -f | ||
<?php | ||
|
||
require_once('haproxy.inc'); | ||
echo "HAProxy Start sync ". (new DateTime('NOW'))->format('c') . "\n"; | ||
haproxy_do_xmlrpc_sync(); | ||
echo "HAProxy Stop sync ". (new DateTime('NOW'))->format('c') . "\n"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters