supervise-daemon: log the exit code or signal when a child process dies
This commit is contained in:
parent
3351c8b4c3
commit
94077d264e
@ -702,8 +702,12 @@ int main(int argc, char **argv)
|
|||||||
syslog(LOG_INFO, "stopping %s, pid %d", exec, child_pid);
|
syslog(LOG_INFO, "stopping %s, pid %d", exec, child_pid);
|
||||||
kill(child_pid, SIGTERM);
|
kill(child_pid, SIGTERM);
|
||||||
} else {
|
} else {
|
||||||
syslog(LOG_INFO, "%s, pid %d, terminated unexpectedly",
|
if (WIFEXITED(i))
|
||||||
exec, child_pid);
|
syslog(LOG_INFO, "%s, pid %d, exited with return code %d",
|
||||||
|
exec, child_pid, WEXITSTATUS(i));
|
||||||
|
else if (WIFSIGNALED(i))
|
||||||
|
syslog(LOG_INFO, "%s, pid %d, terminated by signal %d",
|
||||||
|
exec, child_pid, WTERMSIG(i));
|
||||||
child_pid = fork();
|
child_pid = fork();
|
||||||
if (child_pid == -1)
|
if (child_pid == -1)
|
||||||
eerrorx("%s: fork: %s", applet, strerror(errno));
|
eerrorx("%s: fork: %s", applet, strerror(errno));
|
||||||
|
Loading…
Reference in New Issue
Block a user