[ABRT PATCH 1/4] vmcore: don't fail if /etc/kdump.conf is not readable

Richard Marko rmarko at redhat.com
Tue Sep 3 15:02:23 UTC 2013


Signed-off-by: Richard Marko <rmarko at redhat.com>
---
 src/hooks/abrt_harvest_vmcore.py.in | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/hooks/abrt_harvest_vmcore.py.in b/src/hooks/abrt_harvest_vmcore.py.in
index 4f2e1d0..f2ac4eb 100644
--- a/src/hooks/abrt_harvest_vmcore.py.in
+++ b/src/hooks/abrt_harvest_vmcore.py.in
@@ -47,10 +47,17 @@ def parse_kdump():
     This function parses /etc/kdump.conf to get a path to kdump's
     dump directory.
     """
+    # default
+    dump_path = '/var/crash'
 
     # filesystem types that can be used by kdump for dumping
     fs_types = ['ext4', 'ext3', 'ext2', 'minix', 'btrfs', 'xfs']
 
+    if not os.access('/etc/kdump.conf', os.R_OK):
+        sys.stderr.write("/etc/kdump.conf not readable, using "
+                         "default path '%s'\n" % dump_path)
+        return dump_path
+
     with open('/etc/kdump.conf') as conf_file:
         kdump_conf = conf_file.read()
 
@@ -59,9 +66,6 @@ def parse_kdump():
     result = regexp.search(kdump_conf)
     if result:
         dump_path = result.group(1).strip()
-    else:
-        # default
-        dump_path = '/var/crash'
 
     # default
     partition = None
-- 
1.8.3.1



More information about the Crash-catcher mailing list