Turn off kernel logging

This commit is contained in:
Bob Mottram 2018-04-19 10:41:26 +01:00
parent 541bb3d699
commit b33deeb016
1 changed files with 5 additions and 0 deletions

View File

@ -102,6 +102,7 @@ function turn_off_rsys_logging {
sed -i 's|daemon.\*.*|daemon.\* /dev/null|g' /etc/rsyslog.conf
sed -i 's|mail.\*.*|mail.\* /dev/null|g' /etc/rsyslog.conf
sed -i 's|user.\*.*|user.\* /dev/null|g' /etc/rsyslog.conf
sed -i 's|kern.\*.*|kern.\* /dev/null|g' /etc/rsyslog.conf
sed -i 's|news.none;mail.none.*|news.none;mail.none /dev/null|g' /etc/rsyslog.conf
sed -i 's|\*.\*;auth,authpriv.none.*|\*.\*;auth,authpriv.none /dev/null|g' /etc/rsyslog.conf
sed -i 's|#cron.\*|cron.\*|g' /etc/rsyslog.conf
@ -115,6 +116,9 @@ function turn_off_rsys_logging {
$REMOVE_FILES_COMMAND /var/log/user.*
$REMOVE_FILES_COMMAND /var/log/messages*
$REMOVE_FILES_COMMAND /var/log/syslog*
$REMOVE_FILES_COMMAND /var/log/alternatives*
$REMOVE_FILES_COMMAND /var/log/faillog
$REMOVE_FILES_COMMAND /var/log/kern.log*
}
function turn_on_rsys_logging {
@ -129,6 +133,7 @@ function turn_on_rsys_logging {
sed -i 's|daemon.\*.*|daemon.\* -/var/log/daemon.log|g' /etc/rsyslog.conf
sed -i 's|mail.\*.*|mail.\* -/var/log/mail.log|g' /etc/rsyslog.conf
sed -i 's|user.\*.*|user.\* -/var/log/user.log|g' /etc/rsyslog.conf
sed -i 's|kern.\*.*|kern.\* -/var/log/kern.log|g' /etc/rsyslog.conf
sed -i 's|news.none;mail.none.*|news.none;mail.none -/var/log/debug|g' /etc/rsyslog.conf
sed -i 's|\*.\*;auth,authpriv.none.*|\*.\*;auth,authpriv.none -/var/log/syslog|g' /etc/rsyslog.conf
sed -i 's|#cron.\*|cron.\*|g' /etc/rsyslog.conf