Commit e14d5e28 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(legacy) move logfile generation to system_syslogd_start()

(cherry picked from commit 53747001)
parent f8435a9f
......@@ -934,6 +934,17 @@ EOD;
}
$syslogd_extra = "-f /var/etc/syslog.conf {$sourceip}";
// 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', 'lighttpd'));
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));
}
}
if (isvalidpid('/var/run/syslog.pid')) {
......
......@@ -164,21 +164,6 @@ rm -f /var/run/nologin
rm -rf /tmp/*
chmod 1777 /tmp
echo -n "."
LOG_FILES="system filter dhcpd vpn pptps poes l2tps openvpn portalauth ipsec ppps relayd wireless lighttpd ntpd gateways resolver routing"
DEFAULT_LOG_FILE_SIZE=`/usr/local/bin/xmllint --xpath 'string(//opnsense/syslog/logfilesize)' /conf/config.xml`
if [ ! ${DEFAULT_LOG_FILE_SIZE} ]; then
DEFAULT_LOG_FILE_SIZE=511488
fi
for logfile in $LOG_FILES; do
if [ ! -f /var/log/$logfile.log ]; then
clog -i -s ${DEFAULT_LOG_FILE_SIZE} /var/log/$logfile.log
fi
chmod 0600 /var/log/$logfile.log
done
echo -n "."
/sbin/ldconfig -elf /usr/lib /usr/local/lib /lib
/etc/rc.d/ldconfig start 2>/dev/null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment