diff --git a/src/etc/inc/authgui.inc b/src/etc/inc/authgui.inc index 5d16c089e..728963242 100644 --- a/src/etc/inc/authgui.inc +++ b/src/etc/inc/authgui.inc @@ -132,6 +132,7 @@ function session_auth() openlog("audit", LOG_ODELAY, LOG_AUTH); log_msg($message, $prio); closelog(); + reopenlog(); } if (session_status() == PHP_SESSION_NONE) { diff --git a/src/etc/inc/config.inc b/src/etc/inc/config.inc index 78fa4d958..e94216932 100644 --- a/src/etc/inc/config.inc +++ b/src/etc/inc/config.inc @@ -71,7 +71,13 @@ final class product } } -openlog(product::getInstance()->id(), LOG_ODELAY, LOG_USER); +function reopenlog() +{ + openlog(product::getInstance()->id(), LOG_ODELAY, LOG_USER); +} + +reopenlog(); + register_shutdown_function('closelog'); require_once("xmlparse.inc"); diff --git a/src/etc/inc/filter.inc b/src/etc/inc/filter.inc index 8e154b9f3..0bc62c430 100644 --- a/src/etc/inc/filter.inc +++ b/src/etc/inc/filter.inc @@ -296,6 +296,7 @@ function filter_configure_sync($verbose = false, $load_aliases = true) unlock($filterlck); closelog(); + reopenlog(); service_log("done.\n", $verbose); @@ -394,6 +395,7 @@ function filter_configure_sync($verbose = false, $load_aliases = true) unlock($filterlck); closelog(); + reopenlog(); service_log("failed.\n", $verbose); @@ -435,6 +437,7 @@ function filter_configure_sync($verbose = false, $load_aliases = true) unlock($filterlck); closelog(); + reopenlog(); service_log("failed.\n", $verbose); @@ -468,6 +471,7 @@ function filter_configure_sync($verbose = false, $load_aliases = true) unlock($filterlck); closelog(); + reopenlog(); service_log("done.\n", $verbose); } diff --git a/src/etc/inc/plugins.inc.d/unbound.inc b/src/etc/inc/plugins.inc.d/unbound.inc index d677f2df3..e75ce5372 100644 --- a/src/etc/inc/plugins.inc.d/unbound.inc +++ b/src/etc/inc/plugins.inc.d/unbound.inc @@ -557,6 +557,7 @@ function unbound_add_host_entries($ifconfig_details = null) file_put_contents('/var/unbound/host_entries.conf', $unbound_entries); closelog(); + reopenlog(); } function unbound_acls_subnets() diff --git a/src/libexec/opnsense-auth b/src/libexec/opnsense-auth index 5cc382825..272706080 100755 --- a/src/libexec/opnsense-auth +++ b/src/libexec/opnsense-auth @@ -77,5 +77,4 @@ if (!empty($auth_data['user']) && isset($auth_data['password'])) { } } -closelog(); exit($exit_status); diff --git a/src/sbin/carp_service_status b/src/sbin/carp_service_status index bcfb52bef..242cb9d73 100755 --- a/src/sbin/carp_service_status +++ b/src/sbin/carp_service_status @@ -56,12 +56,10 @@ if (flock($fp, LOCK_EX)) { SRV_FAIL_FACTOR, implode(",", $failed_services) )); set_single_sysctl("net.inet.carp.demotion", SRV_FAIL_FACTOR); - closelog(); } elseif (empty($failed_services) && $demotion_set) { // demotion bitmask set and service(s) operational syslog(LOG_WARNING, sprintf("carp promoted by %d due to service recovery", SRV_FAIL_FACTOR)); set_single_sysctl("net.inet.carp.demotion", -1 * SRV_FAIL_FACTOR); - closelog(); } flock($fp, LOCK_UN);