sos/sos-bz771501-fix-rsyslog-collection-and-size-limit.patch
Bryn M. Reeves 13178ca5fa Update sos to 2.2-29
This synchronises sos in master to the current upstream sos-2.2 branch and
includes all patches from RHEL6 not already present.
2012-06-22 12:16:21 +01:00

31 lines
1.4 KiB
Diff

diff -up sos-2.2/sos/plugins/general.py.orig sos-2.2/sos/plugins/general.py
--- sos-2.2/sos/plugins/general.py.orig 2012-03-06 13:16:08.835478612 +0000
+++ sos-2.2/sos/plugins/general.py 2012-03-06 13:16:12.151478685 +0000
@@ -61,18 +61,14 @@ class general(sos.plugintools.PluginBase
self.addForbiddenPath("/etc/pki/entitlement/*-key.pem")
if self.getOption('all_logs'):
- if rhelver == 5 or rhelver == 4:
- logs=self.doRegexFindAll(r"^\S+\s+(\/.*log.*)\s+$", "/etc/syslog.conf")
- for i in logs:
- if not os.path.isfile(i): continue
- self.addCopySpec(i)
-
- if rhelver == 6:
- logs=self.doRegexFindAll(r"^\S+\s+(\/.*log.*)\s+$", "/etc/rsyslog.conf")
- for i in logs:
- if not os.path.isfile(i): continue
- self.addCopySpec(i)
-
+ logs = self.doRegexFindAll("^\S+\s+(-?\/.*$)\s+", "/etc/syslog.conf")
+ if self.cInfo["policy"].pkgByName("rsyslog") or os.path.exists("/etc/rsyslog.conf"):
+ logs += self.doRegexFindAll("^\S+\s+(-?\/.*$)\s+", "/etc/rsyslog.conf")
+ for i in logs:
+ if i.startswith("-"):
+ i = i[1:]
+ if os.path.isfile(i):
+ self.addCopySpecLimit(i, sizelimit = self.isOptionEnabled("syslogsize"))
return
def postproc(self):