问题
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