firmware: add async reconfigure hook to syslog

rc.configure_plugins is likely fixed, but rc.configure_firmware
has the same issue so make this more maintanable by moving the
async request to the system function and put the former call back
with the async flag set.

Should fix syslog-ng related package configure hangs with regard
to pkg-based bug in recent versions.
This commit is contained in:
Franco Fichtner 2020-10-29 09:08:28 +01:00
parent 0ad3ec432f
commit 4e9a8abf98
3 changed files with 14 additions and 6 deletions

View File

@ -584,14 +584,25 @@ function system_syslogd_extra_local($logsocket)
return exec_safe('-l %s ', $logsocket);
}
function system_syslogd_start($verbose = false, $restart = false)
function system_syslogd_start($verbose = false, $restart = false, $async = false)
{
global $config;
if ($verbose) {
echo 'Configuring system logging...';
flush();
}
if ($async) {
configd_run('syslog restart');
if ($verbose) {
echo "done.\n";
}
return;
}
configd_run('template reload OPNsense/Syslog');
if (empty($config['syslog']['disable_clog'])) {

View File

@ -48,7 +48,7 @@ convert_config(true);
system_firmware_configure(true);
system_trust_configure(true);
system_login_configure(true);
system_syslogd_start(true);
system_syslogd_start(true, false, true);
/* flush user-facing caches */
(new OPNsense\Core\ACL())->invalidateCache();

View File

@ -42,10 +42,7 @@ $script = !empty($argv[1]) ? $argv[1] : 'POST_INSTALL';
/* reload subsystem that may have changed */
if ($script == 'POST_INSTALL') {
echo 'Configuring system logging...';
flush();
configd_run("syslog restart");
echo "done.\n";
system_syslogd_start(true, false, true);
}
/* flush user-facing caches */