diff options
Diffstat (limited to 'pseudo_server.c')
-rw-r--r-- | pseudo_server.c | 11 |
1 files changed, 8 insertions, 3 deletions
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; |