diff options
author | Ermal LUÇI <eri@pfsense.org> | 2014-12-02 11:18:39 +0100 |
---|---|---|
committer | Ermal LUÇI <eri@pfsense.org> | 2014-12-02 11:18:39 +0100 |
commit | 6a1ed2cd200f337a9bb647f19ae66606eb83c638 (patch) | |
tree | 02ced001a192fc20ae4faca7cc3d0e559b4733e0 /etc | |
parent | 1ff8e8f65a6bd3510fbaedfecb637c5a5833d442 (diff) | |
download | pfsense-6a1ed2cd200f337a9bb647f19ae66606eb83c638.zip pfsense-6a1ed2cd200f337a9bb647f19ae66606eb83c638.tar.gz |
Avoid calling exit in backend now that fpm is used for php since its a pesimization and can break calling scripts assumption on locks.
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/rc.filter_synchronize | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/etc/rc.filter_synchronize b/etc/rc.filter_synchronize index cb6e499..c6fbf99 100755 --- a/etc/rc.filter_synchronize +++ b/etc/rc.filter_synchronize @@ -117,7 +117,7 @@ function carp_check_version($url, $username, $password, $port = 80, $method = 'p $error = "An authentication failure occurred while trying to access {$url}:{$port} ({$method})."; log_error($error); file_notice("sync_settings", $error, "Settings Sync", ""); - exit; + return false; } } else { if (!isset($parsed_response['config_version']) || @@ -260,7 +260,7 @@ function carp_sync_xml($url, $username, $password, $sections, $port = 80, $metho $error = "An authentication failure occurred while trying to access {$url}:{$port} ($method)."; log_error($error); file_notice("sync_settings", $error, "Settings Sync", ""); - exit; + return -1; } else { log_error("XMLRPC sync successfully completed with {$url}:{$port}."); update_filter_reload_status("XMLRPC sync successfully completed with {$url}:{$port}."); @@ -280,7 +280,7 @@ if (is_array($config['hasync'])) { if (empty($hasync['synchronizetoip'])) { /* this gets hit on every filter sync on the secondary, a log here creates a lot of log spam and I never saw it actually log anything useful */ - exit; + return; } /* @@ -396,7 +396,7 @@ if (is_array($config['hasync'])) { if (count($sections) <= 0) { log_error("Nothing has been configured to be synched. Skipping...."); - exit; + return; } if (empty($hasync['username'])) @@ -405,10 +405,11 @@ if (is_array($config['hasync'])) { $username = $hasync['username']; if (!carp_check_version($synchronizetoip, $username, $hasync['password'], $port)) - exit; + return; update_filter_reload_status("Signaling CARP reload signal..."); - carp_sync_xml($synchronizetoip, $username, $hasync['password'], $sections, $port); + if (carp_sync_xml($synchronizetoip, $username, $hasync['password'], $sections, $port) == -1) + return; $cli = new XML_RPC_Client('/xmlrpc.php', $synchronizetoip, $port); $params = array( XML_RPC_encode($hasync['password']) |