Syslog-NG, restart both syslog daemons on service restarts to avoid communication issues. Since both services (syslog-ng, syslog) have their own status its good to show them separately, for proper functionality they should however be treated as one.

Add a stop action to prevent service stop from only stopping the service named "syslog".
This commit is contained in:
Ad Schellevis 2019-06-17 13:36:17 +02:00
parent 6b92b81702
commit dd01423e91
2 changed files with 13 additions and 3 deletions

View File

@ -82,6 +82,7 @@ function core_services()
$services[] = array(
'description' => gettext('Local Syslog'),
'php' => array(
"stop" => array('system_syslogd_stop'),
"start" => array('system_syslogd_start'),
"restart" => array('system_syslogd_start')
),
@ -92,9 +93,9 @@ function core_services()
$services[] = array(
'description' => gettext('Remote Syslog'),
'mwexec' => array(
'restart' => array('/usr/local/etc/rc.d/syslog-ng restart'),
'start' => array('/usr/local/etc/rc.d/syslog-ng start'),
'stop' => array('/usr/local/etc/rc.d/syslog-ng stop'),
"stop" => array('system_syslogd_stop'),
"start" => array('system_syslogd_start'),
"restart" => array('system_syslogd_start')
),
'pidfile' => '/var/run/syslog-ng.pid',
'name' => 'syslog-ng',

View File

@ -657,6 +657,15 @@ EOD;
}
}
/**
* stop syslog + syslog-ng
*/
function system_syslogd_stop()
{
killbypid('/var/run/syslog.pid', 'TERM', true);
mwexecf("/usr/sbin/service syslog-ng stop");
}
function system_clear_log($logfile, $restart_syslogd = true)
{
if ($restart_syslogd) {