[master 2/2] Log crashes from the signal handler.

dashea installerbot-noreply at redhat.com
Thu Sep 24 21:17:06 UTC 2015


From: David Shea <dshea at redhat.com>

---
 pyanaconda/isys/isys.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/pyanaconda/isys/isys.c b/pyanaconda/isys/isys.c
index 6cbadf2..76ec39f 100644
--- a/pyanaconda/isys/isys.c
+++ b/pyanaconda/isys/isys.c
@@ -30,6 +30,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <fcntl.h>
+#include <syslog.h>
 
 static PyObject * doSignalHandlers(PyObject *s, PyObject *args);
 static PyObject * doSetSystemTime(PyObject *s, PyObject *args);
@@ -102,6 +103,13 @@ static void sync_signal_handler(int signum) {
     size = backtrace (array, 20);
     backtrace_symbols_fd(array, size, STDOUT_FILENO);
 
+    /* Log the crash. Hopefully this is happening after logging has started
+     * and livemedia-creator will get the message. */
+    openlog("anaconda", 0, LOG_USER);
+    syslog(LOG_CRIT, "Anaconda crashed on signal %d", signum);
+    closelog();
+
+
     /* Try call gcore on ourself to write out a core file */
     pid_size = snprintf(NULL, 0, "%d", getpid());
     if (pid_size <= 0) {


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/c34b95ba5336b6293299368b1d825357b6cb081e


More information about the anaconda-patches mailing list