[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH master f14-branch] (take II) Copy ifcfg.log into traceback and installed system.

ifcfg.log is used mainly for logging state of ifcfg files
(what we write, how NM updates it, what user does in nm-c-e).

It would be really useful for me to have ifcfg.log among logs
on target system (and in traceback file). Network errors/misconfs
are often nonfatal, so let's make getting the logs we need

This is take 2, Chris suggested to move all the logs into a
directory in /var/log instead of polluting /var/log with another
anaconda.* log file.

I'll update http://fedoraproject.org/wiki/Anaconda/Logging
and http://fedoraproject.org/wiki/Anaconda/BugReporting
if acked.

I have also a patch improving the ifcfg.log format and content:
It'd be nice to have that in f14 too, but it is not as important as
this patch for me.

 pyanaconda/exception.py |    4 ++--
 pyanaconda/packages.py  |    8 ++++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
index 1075717..e686427 100644
--- a/pyanaconda/exception.py
+++ b/pyanaconda/exception.py
@@ -91,8 +91,8 @@ class AnacondaExceptionHandler(ExceptionHandler):
 def initExceptionHandling(anaconda):
     fileList = [ "/tmp/anaconda.log", "/tmp/lvmout", "/tmp/resize.out",
-                 "/tmp/program.log", "/tmp/storage.log", "/tmp/yum.log",
-                 anaconda.rootPath + "/root/install.log",
+                 "/tmp/program.log", "/tmp/storage.log", "/tmp/ifcfg.log",
+                 "/tmp/yum.log", anaconda.rootPath + "/root/install.log",
                  anaconda.rootPath + "/root/upgrade.log", "/proc/cmdline" ]
     if flags.livecdInstall:
diff --git a/pyanaconda/packages.py b/pyanaconda/packages.py
index 7d88d06..04b8967 100644
--- a/pyanaconda/packages.py
+++ b/pyanaconda/packages.py
@@ -67,16 +67,20 @@ def writeKSConfiguration(anaconda):
 def copyAnacondaLogs(anaconda):
     log.info("Copying anaconda logs")
+    if not os.path.isdir (anaconda.rootPath + '/var/log/anaconda'):
+        os.mkdir(anaconda.rootPath + '/var/log/anaconda')
     for (fn, dest) in (("/tmp/anaconda.log", "anaconda.log"),
                        ("/tmp/syslog", "anaconda.syslog"),
                        ("/tmp/X.log", "anaconda.xlog"),
                        ("/tmp/program.log", "anaconda.program.log"),
                        ("/tmp/storage.log", "anaconda.storage.log"),
+                       ("/tmp/ifcfg.log", "anaconda.ifcfg.log"),
                        ("/tmp/yum.log", "anaconda.yum.log")):
         if os.access(fn, os.R_OK):
-                shutil.copyfile(fn, "%s/var/log/%s" %(anaconda.rootPath, dest))
-                os.chmod("%s/var/log/%s" %(anaconda.rootPath, dest), 0600)
+                shutil.copyfile(fn, "%s/var/log/anaconda/%s" %(anaconda.rootPath, dest))
+                os.chmod("%s/var/log/anaconda/%s" %(anaconda.rootPath, dest), 0600)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]