mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 10:04:41 +00:00
syslog: don't generate clog files when disable_clog is set.
eventually we should also prevent the legacy syslog from starting, but first make sure we don't polute the filesystem in these cases
This commit is contained in:
parent
489125276c
commit
b1ec4aa9b0
@ -653,15 +653,17 @@ EOD;
|
||||
$syslogd_extra .= exec_safe('-f %s ', '/var/etc/syslog.conf');
|
||||
|
||||
// setup log files for all facilities including default
|
||||
$default_logfile_size = !empty($syslogcfg['logfilesize']) ? $syslogcfg['logfilesize'] : '511488';
|
||||
$syslog_files = array_keys($syslogconfs);
|
||||
$syslog_files = array_merge($syslog_files, array('system', 'vpn'));
|
||||
foreach ($syslog_files as $syslog_fn) {
|
||||
$filename = "/var/log/" . basename($syslog_fn) . ".log";
|
||||
if (!file_exists($filename)) {
|
||||
mwexecf('/usr/local/sbin/clog -i -s %s %s', array($default_logfile_size, $filename));
|
||||
if (empty($config['syslog']['disable_clog'])) {
|
||||
$default_logfile_size = !empty($syslogcfg['logfilesize']) ? $syslogcfg['logfilesize'] : '511488';
|
||||
$syslog_files = array_keys($syslogconfs);
|
||||
$syslog_files = array_merge($syslog_files, array('system', 'vpn'));
|
||||
foreach ($syslog_files as $syslog_fn) {
|
||||
$filename = "/var/log/" . basename($syslog_fn) . ".log";
|
||||
if (!file_exists($filename)) {
|
||||
mwexecf('/usr/local/sbin/clog -i -s %s %s', array($default_logfile_size, $filename));
|
||||
}
|
||||
mwexecf('chmod 0600 %s', array($filename));
|
||||
}
|
||||
mwexecf('chmod 0600 %s', array($filename));
|
||||
}
|
||||
|
||||
if (!$restart && isvalidpid('/var/run/syslog.pid')) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user