summaryrefslogtreecommitdiff
path: root/extra/networkmanager/repair-signals.patch
blob: cf1319dc5837729a72d673df0161d101f7674004 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From 64342a313ef497fca8a4fb7567900d4a1460065f Mon Sep 17 00:00:00 2001
From: Alexandre Rostovtsev <tetromino@gentoo.org>
Date: Thu, 13 Sep 2012 09:32:53 +0000
Subject: 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.
---
diff --git a/src/main.c b/src/main.c
index 8bc6d3f..5b82cfa 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;
 
--
cgit v0.9.0.2-2-gbebe