Is there a way to start a script that runs forever - without passing a phenomenally large number to async?
The problem with async is that after the timeout, it calls os.killpg on the process group with SIGKILL, so no matter how much I nohup, detach, subshell the child task, even if it has a PPID of 1, it's still in the same process group.
I don't want to have async running forever either, as then there are three long running ansible processes just hanging around making the process table look untidy.
I have tried to make the script run the task using nohup and then calling the command module without async, but then for some reason it hangs in run_command
A fully working example (ok, it only sleeps for 10000 seconds but that will do) is at:
https://gist.github.com/willthames/7260782It's worth noting that even after the KeyboardInterrupt, the sleep process is running.
Is there a better way of doing this? Are there arguments against sending a different signal to os.killpg (SIGHUP seems like an obvious one that I could protect against with nohup or trap)
Thanks,
Will