I need to write an overseer process responsible for forking and managing number of children processes in Linux.
The parent process (overseer) is responsible for:
- starting and stopping children processes (workers)
- restarting them in case of problems
- keeping the configured number of children alive
I’m looking for a proven skeleton / tutorial on how to do it right.
(I do understand processes, threads and Linux signals, but I’m far from expert in that regard and seek for the best practices to avoid troubles).
After a long research I have found a nice and simple implementation in the Preforker gem: https://github.com/dcadenas/preforker (Ruby).
Preforker provides exactly what I need.