Detach from running process

人盡茶涼 提交于 2019-12-10 23:12:34

问题


I am facing a funny situation:

I'm developing a flashlight plugin to trigger an alarm at some point in the future.

The problem is, flashlight kills the script after 30 seconds. So I can neither wait long enough to activate the alarm nor play the alarm indefinitely until the user cancels it.

So, I am looking to find a way for the script to "detach" itself from (or otherwise prevent itself from being killed by) its parent process.

Could this be accomplished by daemonising itself?


回答1:


I believe the term you are looking for is "fork", such as the one found in the os library.



来源:https://stackoverflow.com/questions/41416596/detach-from-running-process

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