5 ms·
> Using the separate process to spawn is a smart idea. Especially if you can talk to it via a process shared condition variable. You can even use prctl(2) to s
by zbentley 2y ago
> Using the separate process to spawn is a smart idea. Especially if you can talk to it via a process shared condition variable.
You can even use prctl(2) to set the parent as a subreaper for the spawner’s children so the process hierarchy continues to behave as expected and you don’t end up with orphans. Or just run such that the parent is PID 1 in a container anyway.
With either approach, watch out if you’re using a thicker runtime/language whose child process accounting can get freaked out if an unexpectedly-present child indicates ready-for-reap. Using pidfds on Linux (optionally combined with fdpass via UNIX sockets to signal that the spawner did its thing) can help with this.