Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Do not comment out rsyslog /var/log/messages on MN #4527

Merged
merged 1 commit into from
Jan 11, 2018

Conversation

sebth
Copy link
Contributor

@sebth sebth commented Dec 14, 2017

Since xCAT 2.11, the rule *.debug /var/log/messages is no longer added to rsyslog.conf on the MN, but all pre-existing rules ending with "/var/log/messages" are still commented out. Is this a mistake? I cannot imagine that xCAT is supposed to disable all logging to /var/log/messages (though, it enables the daemon and ftp facilities in the config file /etc/rsyslog.d/xcat-debug.conf, still leading to a "/var/log/messages" that is missing a lot of messages).

This PR has a commit that solves the problem, though I am not sure how to properly solve duplicate messages coming from /etc/rsyslog.d/xcat-debug.conf, hence the RFC tag. Still, duplicate messages are better than missing messages!

Since commit 1219fdd, 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.
@xcatbot
Copy link

xcatbot commented Dec 14, 2017

CI CHECK RESULT : > PR FORMAT CORRECT> BUILD SUCCESSFUL > INSTALL XCAT SUCCESSFUL> CODE SYNTAX CORRECT> FAST REGRESSION TEST Successful: Totalcase 215 Pass 215 failed 0

@whowutwut
Copy link
Member

@sebth Thanks for your interest in the xCAT project and your pull request! We appreciate it. Before we are able to accept contributions, we do require a CLA to be signed. You can find the document and instructions here:
http://xcat-docs.readthedocs.io/en/stable/developers/license/contributors.html

CLA or CCLA (corporate).. If you are covered under a corporate CLA, please let us know the company and we will add your ID into the list. Thanks!

@immarvin
Copy link
Contributor

hi @sebth , xCAT ships some log filter rules, such as "xcat-compute.conf" and "xcat-cluster.conf" and "xcat-debug.conf", the logs which pass the filters will go to separate log files to facilitate debug

Just as you mentioned, commenting out the log entry for /var/log/messages is to avoid duplicate logs. The duplicate logs introduce some trouble when these logs are processed by some log analysis tools, such as ELK and xcatprobe shipped by xCAT.

of course, this was just our idea on this, it is open to discuss and determine whether this is reasonable from the user's perspective

@sebth
Copy link
Contributor Author

sebth commented Dec 15, 2017

@whowutwut Thanks, I will look into the CLA if the discussion on this PR leads to a commit that would be accepted.

@immarvin I think that if xCAT needs to take control over /var/log/messages, it should set a reasonable rule. As of now, if you install xCAT on a RHEL 7 system, /var/log/messages will suddenly only show the daemon and ftp facilities. For instance, kernel messages will no longer be logged anywhere. As a user, I think this is unexpected and a bit dangerous. The previous default of sending "*.debug" to /var/log/messages was more reasonable.

Though I would personally prefer if xCAT did not touch /etc/rsyslog.conf at all, and redirected the things it needed to analyze to something like /var/log/xcat/debug.log by a rule in /etc/rsyslog.d/xcat-debug.conf, I think the most important thing is that xCAT does not set a too minimal rule for /var/log/messages like it does right now.

@whowutwut
Copy link
Member

@immarvin @neo954 I do agree with @sebth ... Why do we need to touch the main rsyslog config file /etc/rsyslog.conf file if we have the option to provide our own user defined ones in /etc/rsyslog.d?

/etc/rsyslog.conf has this config setting:

$IncludeConfig /etc/rsyslog.d/*.conf

In the past we did have some issues during updates and messing with other config in that file, so we now wrap with our own tags to search and replace only between those...

# xCAT settings START
# Entries between the START and END lines will be replaced on the next xCAT install or update
#*.debug   /var/log/messages
# xCAT settings END

@neo954
Copy link
Contributor

neo954 commented Dec 27, 2017

@whowutwut, we don't really need to touch /etc/rsyslog.conf. Those codes were there just because they are historical remains. I think just comment out line 121 and line 213 in file xCAT/postscripts/syslog will satisfy @sebth's need.

And for this change, we still need some extra lines to handle the situation of xCAT migration. For example upgrade from xCAT 2.10 to 2.11, or 2.10 to 2.13. Uncomment the line in /etc/rsyslog.conf which was commented out by postscript syslog prior to xCAT 2.11. That line should look like the following line in RHEL7. But it shows differently in RHEL6, RHEL5, RHEL4, SLES 12, and Ubuntu.

*.info;mail.none;authpriv.none;cron.none                /var/log/messages

@immarvin immarvin merged commit fc58a8e into xcat2:master Jan 11, 2018
@immarvin
Copy link
Contributor

i am ok with the change

@immarvin immarvin self-requested a review January 11, 2018 03:01
@immarvin immarvin added this to the 2.13.10 milestone Jan 11, 2018
@robin2008
Copy link
Member

Known issue:
This PR works fine with new installed xCAT on fresh MN. But if you upgrade from previous xCAT version, you must take some manual actions. Or /var/log/messages won't have the logs as expected.

It is caused that the /etc/rsyslog.conf is already modified by xCAT, so all default rules to /var/log/messages are disabled. And after the fix, the rule in /etc/rsyslog.d/xcat-debug.conf is not working too. You have to recover the default rules in /etc/rsyslog.conf.

@whowutwut
Copy link
Member

whowutwut commented Mar 23, 2018

@immarvin Seems like this was merged without a CLA sent to xCAT Team, or i apologize if I missed the email. please let me know. @sebth if possible could you fill out a CLA for a our records.

@whowutwut Thanks, I will look into the CLA if the discussion on this PR leads to a commit that would be accepted.

http://xcat-docs.readthedocs.io/en/stable/developers/license/contributors.html

@sebth
Copy link
Contributor Author

sebth commented Mar 26, 2018

@whowutwut I have emailed a signed CLA to 'xcat-legal' just now.

@whowutwut
Copy link
Member

@sebth Got it, Thank you! I have sent an invite to be part of the xCAT contributor team, you can accept or not, no requirement to do so but just sent it incase. Welcome!

@sebth
Copy link
Contributor Author

sebth commented Mar 28, 2018

@whowutwut Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants