SIGKILL signal Handler

后端 未结 1 448
情书的邮戳
情书的邮戳 2020-11-30 05:57

I have a requirement to write to a log file on reception of any terminate command like SIGTERM AND SIGKILL.

I can register for SIGTERM but how can handle the SIGKILL

相关标签:
1条回答
  • 2020-11-30 06:40

    You cannot, at least not for the process being killed.

    What you can do is arrange for the parent process to watch for the child process's death, and act accordingly. Any decent process supervision system, such as daemontools, has such a facility built in.

    0 讨论(0)
提交回复
热议问题