由于一些热插拔问题,类似于所说的这里,TTY 显示器显示连续的消息流(这些消息也记录在 /var/log 目录中)。我输入的每个文本都会在视觉上消失,但它确实会接受输入(我可以登录并运行命令)。
有没有办法防止此类错误和/或任何其他广播消息淹没 TTY?
更新:这是所请求文件的内容/etc/rsyslog.conf
:
# /etc/rsyslog.conf Configuration file for rsyslog.
#
# For more information see
# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html
#
# Default logging rules can be found in /etc/rsyslog.d/50-default.conf
#################
#### MODULES ####
#################
$ModLoad imuxsock # provides support for local system logging
$ModLoad imklog # provides kernel logging support (previously done by rklogd)
#$ModLoad immark # provides --MARK-- message capability
# provides UDP syslog reception
#$ModLoad imudp
#$UDPServerRun 514
# provides TCP syslog reception
#$ModLoad imtcp
#$InputTCPServerRun 514
# Enable non-kernel facility klog messages
$KLogPermitNonKernelFacility on
###########################
#### GLOBAL DIRECTIVES ####
###########################
#
# Use traditional timestamp format.
# To enable high precision timestamps, comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
# Filter duplicated messages
$RepeatedMsgReduction on
#
# Set the default permissions for all log files.
#
$FileOwner syslog
$FileGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022
$PrivDropToUser syslog
$PrivDropToGroup syslog
#
# Where to place spool files
#
$WorkDirectory /var/spool/rsyslog
#
# Include all config files in /etc/rsyslog.d/
#
$IncludeConfig /etc/rsyslog.d/*.conf
答案1
简单的解决方法是注释掉以下行/etc/rsyslog.conf
:
# Everybody gets emergency messages
#*.emerg :omusrmsg:*
至少它对我的 RHEL 7.9 机器有效。
要保留这些消息并使其易于查找,您可以将它们写入特定文件。像这样的东西:
*.emerg /var/log/remote.log
是的。该设置作为默认设置是超级侵入性的。在系统日志服务器上,环境中任何抛出紧急消息的服务器都可能淹没控制台。