aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.txt3
-rw-r--r--pseudo_server.c11
2 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 8eb7917..f746c18 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,6 @@
+2016-09-22:
+ * (seebs) don't send SIGUSR1 to init.
+
2016-07-29:
* (seebs) Don't clear bindings for a statement with no bindings.
diff --git a/pseudo_server.c b/pseudo_server.c
index 65102dd..8731d20 100644
--- a/pseudo_server.c
+++ b/pseudo_server.c
@@ -358,9 +358,14 @@ pseudo_server_start(int daemonize) {
signal(SIGTERM, quit_now);
/* tell parent process to stop waiting */
if (daemonize) {
- pseudo_diag("Setup complete, sending SIGUSR1 to pid %d.\n",
- getppid());
- kill(getppid(), SIGUSR1);
+ pid_t ppid = getppid();
+ if (ppid == 1) {
+ pseudo_diag("Setup complete, but parent is init, not sending SIGUSR1.\n");
+ } else {
+ pseudo_diag("Setup complete, sending SIGUSR1 to pid %d.\n",
+ ppid);
+ kill(ppid, SIGUSR1);
+ }
}
pseudo_server_loop();
return 0;