Skip to content

Commit

Permalink
Added SIGTERM marker in the filesystem (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Slusarczyk authored May 13, 2019
1 parent 8a7ddcb commit 5f05558
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dumb-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ void forward_signal(int signum) {
signum = translate_signal(signum);
if (signum != 0) {
if (signum == SIGTERM) {
sleep(forward_sleep);
FILE* dump_init_stop_signal_received_file_ptr = fopen("/tmp/dump-init-stop-signal-received", "w");
fclose(dump_init_stop_signal_received_file_ptr);
sleep(forward_sleep);
}
kill(use_setsid ? -child_pid : child_pid, signum);
DEBUG("Forwarded signal %d to children.\n", signum);
Expand Down

0 comments on commit 5f05558

Please sign in to comment.