2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 01:26:38 +00:00

Do not comment out rsyslog /var/log/messages on MN (#4527)

Since commit 1219fdd23fb8602bb1029b96bb69cf4d746f0029, the rsyslog rule
"*.debug /var/log/messages" is no longer added to rsyslog.conf on the
MN. However, any rule ending with "/var/log/messages" is still commented
out. This leads to xCAT removing all output to /var/log/messages, except
for the daemon and ftp facilities that are enabled by
/etc/rsyslog.d/xcat-debug.conf!

This commit
 - stops commenting out rules ending with "/var/log/messages" in
   rsyslog.conf
 - stops adding adding the comment "#*.debug /var/log/messages" to
   rsyslog.conf
 - changes "daemon.debug" to "daemon.=debug" in xcat-debug.conf to avoid
   duplicate daemon log lines with most Linux distributions' default
   rsyslog.conf.

The 'ftp.* rule in xcat-debug.conf is possibly no longer needed, and
will lead to duplicate ftp messages with most distributions, but it is
left untouched in this commit.
This commit is contained in:
Sebastian Thorarensen 2018-01-11 04:00:59 +01:00 committed by yangsong
parent b750ea34d4
commit fc58a8e872
2 changed files with 5 additions and 13 deletions

View File

@ -1,3 +1,3 @@
# By default, dhcpd use the ``daemon'' facility. Thus dhcp logs will go here.
# ftp.* is for tftp log.
daemon.debug;ftp.* /var/log/messages
# Make sure dhcpd requests and responses (daemon.=debug) and
# tftp messages (ftp.*) are logged.
daemon.=debug;ftp.* /var/log/messages

View File

@ -117,11 +117,8 @@ config_Rsyslog_C3()
#enable to send the logging to master
if [ $isLocal -eq 1 ]; then
#enable the MN to log all the logs from CN and MN itself
sed -i 's/\(^[^\#].*\/var\/log\/messages\)/\#\1/g' $2
echo "#*.debug /var/log/messages" >> $2
touch /var/log/messages
if ( pmatch $OSVER "ubuntu*" ) || ( is_lsb_ubuntu ) || ( pmatch $OSVER "debian*" ); then
touch /var/log/messages
chown syslog:adm /var/log/messages
sed -i 's/\$PrivDropToGroup syslog/\$PrivDropToGroup adm/' $2
chown syslog:adm /var/log/xcat
@ -200,7 +197,7 @@ config_rsyslog_V8()
if [ $goLocal -eq 1 ]; then
#logging is local, do not forward
#making sure all the messages goes to /var/log/messages
#making sure /var/log/messages is setup for xcat-debug
touch /var/log/messages
if ( pmatch $OSVER "ubuntu*" ) || ( is_lsb_ubuntu ) || ( pmatch $OSVER "debian*" ); then
chown syslog:adm /var/log/messages
@ -208,14 +205,9 @@ config_rsyslog_V8()
chown syslog:adm /var/log/xcat
fi
#comment out the rules which will write logs to /var/log/messages
# to prevent duplicate logs after "syslog" script is run
sed -i '/^[^#].*\/var\/log\/messages/s/^/#/' $conf_file
# Mark the start of xCAT section
echo "# $xCATSettingsSTART" >> $conf_file
echo "# $xCATSettingsInfo" >> $conf_file
echo "#*.debug /var/log/messages" >> $conf_file
# Need to uncomment the lines $ModLoad imudp.so and $UDPServerRun 514,
# to make the MN be able to receive syslog from remote hosts
if [ -f "$remoteconf" ]; then