Open sheerun opened 6 years ago
Processes have to be run in their own sessions because of PTY. It's not possible to run a process in a different session but the same group ID. Correct me if I'm wrong.
You're correct. According to this stackoverflow, it seems the solution would be to use:
Or you cold record spawned pids and kill / reattach to them when running second time after crash. Of course it would leave these processes running until hivemind is started again. Not sure which solution is worse, but probably both better than allowing sub-processes to run indefinitely after hivemind crashes or gets killed.
Because subprocesses aren't in the same process group as hivemind, when hivemind gets killed for some reason, the subprocesses arn't killed and are disowned instead.
Could you please spawn subprocesses in the same process group?