const char *signame;
/*
- * The worker will its parent's signals since they are part of the same
- * process group. However, in the case of SIGINT and SIGTERM, we want
- * to give the worker a chance to teardown gracefully when its parent
- * closes the command socket.
+ * The worker will inherit its parent's signals since they are part of
+ * the same process group. However, in the case of SIGINT and SIGTERM,
+ * we want to give the worker a chance to teardown gracefully when its
+ * parent closes the command socket.
*/
switch (sig) {
case SIGINT:
signame = "SIGTERM";
break;
default:
- signame = "Unknown";
+ signame = NULL;
}
- DBG("run_as worker received signal %s", signame);
+ if (signame) {
+ DBG("run_as worker received signal %s", signame);
+ } else {
+ DBG("run_as_worker received signal %d", sig);
+ }
}
static