diff options
author | Alexandre Rostovtsev <tetromino@gentoo.org> | 2012-09-13 05:32:53 -0400 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2012-09-17 14:47:06 +0200 |
commit | 64342a313ef497fca8a4fb7567900d4a1460065f (patch) | |
tree | 4f1473808ef2c9aa7d05d474c7becb5c7765422b | |
parent | 866218b4155de817c15d64afab8a275136c00dd0 (diff) |
core: wait until we daemonized before setting up signals (bgo #683932)
If we mask signals before daemonizing, the daemon process will not be
able to handle them, and thus would be unkillable with anything other
than SIGKILL.
-rw-r--r-- | src/main.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -401,10 +401,6 @@ main (int argc, char *argv[]) exit (1); } - /* Set up unix signal handling */ - if (!setup_signals ()) - exit (1); - /* Set locale to be able to use environment variables */ setlocale (LC_ALL, ""); @@ -501,6 +497,10 @@ main (int argc, char *argv[]) wrote_pidfile = TRUE; } + /* Set up unix signal handling - before creating threads, but after daemonizing! */ + if (!setup_signals ()) + exit (1); + if (g_fatal_warnings) { GLogLevelFlags fatal_mask; |