|
|
0cd6dc |
From d9e1c2a6dafd50146958c143ff0f39237788d10a Mon Sep 17 00:00:00 2001
|
|
|
0cd6dc |
From: "Bryn M. Reeves" <bmr@redhat.com>
|
|
|
0cd6dc |
Date: Mon, 26 Jan 2015 00:09:11 +0000
|
|
|
0cd6dc |
Subject: [PATCH 70/93] [logs] fix do_regex_find_all() use for --sysroot
|
|
|
0cd6dc |
|
|
|
0cd6dc |
The logs plugin searches syslog configuration files. When using
|
|
|
0cd6dc |
--sysroot the plugin needs to use join_sysroot() to open the
|
|
|
0cd6dc |
correct path.
|
|
|
0cd6dc |
|
|
|
0cd6dc |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
0cd6dc |
---
|
|
|
0cd6dc |
sos/plugins/logs.py | 8 ++++----
|
|
|
0cd6dc |
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
|
0cd6dc |
|
|
|
0cd6dc |
diff --git a/sos/plugins/logs.py b/sos/plugins/logs.py
|
|
|
0cd6dc |
index 15ae26a..55468cb 100644
|
|
|
0cd6dc |
--- a/sos/plugins/logs.py
|
|
|
0cd6dc |
+++ b/sos/plugins/logs.py
|
|
|
0cd6dc |
@@ -37,12 +37,12 @@ class Logs(Plugin):
|
|
|
0cd6dc |
])
|
|
|
0cd6dc |
|
|
|
0cd6dc |
if self.get_option('all_logs'):
|
|
|
0cd6dc |
- logs = self.do_regex_find_all("^\S+\s+(-?\/.*$)\s+",
|
|
|
0cd6dc |
- "/etc/syslog.conf")
|
|
|
0cd6dc |
+ syslog_conf = self.join_sysroot("/etc/syslog.conf")
|
|
|
0cd6dc |
+ logs = self.do_regex_find_all("^\S+\s+(-?\/.*$)\s+", syslog_conf)
|
|
|
0cd6dc |
if self.is_installed("rsyslog") \
|
|
|
0cd6dc |
or os.path.exists("/etc/rsyslog.conf"):
|
|
|
0cd6dc |
logs += self.do_regex_find_all("^\S+\s+(-?\/.*$)\s+",
|
|
|
0cd6dc |
- "/etc/rsyslog.conf")
|
|
|
0cd6dc |
+ rsyslog_conf)
|
|
|
0cd6dc |
for i in logs:
|
|
|
0cd6dc |
if i.startswith("-"):
|
|
|
0cd6dc |
i = i[1:]
|
|
|
0cd6dc |
@@ -61,7 +61,7 @@ class RedHatLogs(Logs, RedHatPlugin):
|
|
|
0cd6dc |
messages = "/var/log/messages"
|
|
|
0cd6dc |
self.add_copy_spec_limit("/var/log/secure*", sizelimit=self.limit)
|
|
|
0cd6dc |
self.add_copy_spec_limit(messages + "*", sizelimit=self.limit)
|
|
|
0cd6dc |
- # collect five days worth of logs by default if the system is
|
|
|
0cd6dc |
+ # collect three days worth of logs by default if the system is
|
|
|
0cd6dc |
# configured to use the journal and not /var/log/messages
|
|
|
0cd6dc |
if not os.path.exists(messages) and self.is_installed("systemd"):
|
|
|
0cd6dc |
try:
|
|
|
0cd6dc |
--
|
|
|
0cd6dc |
1.9.3
|
|
|
0cd6dc |
|