Menu

#14 signal handlers should be reset for the kernel logger proces

open
nobody
None
5
2013-11-12
2009-07-03
Ani Sinha
No

The signal handlers that are set up for the parent gets propagated to the child kernel logger process after fork(). The handlers should be reset to default. Otherwise among other issues, when the child tries to write to the uninitialized socket pair, the write will fail. Please also note that only the parent initializes the signal queueing socket pairs.

Suggesting to add the following patch to metalog:

Index: metalog-0.8/src/metalog.c

--- metalog-0.8.orig/src/metalog.c
+++ metalog-0.8/src/metalog.c
@@ -446,6 +446,12 @@ static int getDataSources(int sockets[])

signal(SIGUSR1, SIG_IGN);
signal(SIGUSR2, SIG_IGN);
+ signal(SIGCHLD, SIG_DFL);
+ signal(SIGPIPE, SIG_DFL);
+ signal(SIGHUP, SIG_DFL);
+ signal(SIGTERM, SIG_DFL);
+ signal(SIGQUIT, SIG_DFL);
+ signal(SIGINT, SIG_DFL);
setpgid((pid_t) 0, pgid);
setprogname(PROGNAME_KERNEL);
if (klogctl(1, NULL, 0) < 0 ||

Discussion


Log in to post a comment.

MongoDB Logo MongoDB