SIGKILL signal Handler

谁说我不能喝 提交于 2019-11-26 20:15:17

问题


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 signal?


回答1:


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.



来源:https://stackoverflow.com/questions/3908694/sigkill-signal-handler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!