Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix child exit, reset signals

  • Loading branch information...
commit 66b84e382fad7350c45e300b0929f639df98cb9d 1 parent 615aed6
TJ Holowaychuk authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/mon.c
7 src/mon.c
View
@@ -81,13 +81,14 @@ alive(pid_t pid) {
}
/*
- * Kill everythanggg.
+ * Graceful exit, signal child.
*/
void
graceful_exit(int sig) {
log("shutting down");
- kill(pid, sig);
+ log("kill(%d, %d)", sig, pid);
+ kill(pid, SIGKILL);
exit(1);
}
@@ -211,6 +212,8 @@ exec: {
perror("fork()");
exit(1);
case 0:
+ signal(SIGTERM, SIG_DFL);
+ signal(SIGQUIT, SIG_DFL);
log("sh -c \"%s\"", cmd);
execl("/bin/sh", "sh", "-c", cmd, 0);
perror("execl()");
Please sign in to comment.
Something went wrong with that request. Please try again.