|Don't ask to ask, just ask|
Looking for a daemonizing moduleby Dallaylaen (Chaplain)
|on Sep 06, 2019 at 21:34 UTC||Need Help??|
Dallaylaen has asked for the wisdom of the Perl Monks concerning the following question:
Hello dear esteemed monks,
We need to daemonize a queue-processing program (been using uWSGI for that, but it's kind of awkward). So I'm looking for a module that would do the trick for me. Specifically I need the following:
1. forking a configurable number of worker processes;
2. Starting/stopping them (via a pid file?);
3. Graceful restart - the old workers can keep processing their last request for as long as needed, and the new ones are spawned to take over;
4. Ability to specify number of requests being processed after which a child exits and is replaced by a new one.
While I'm definitely able to write all of the above, maybe there is a module that already does that. Any::Daemon seems close to the above spec but 10% test coverage is a bit scary. Any suggestions?
UPDATE: We're running Linux. Although I assume a "generic daemonizing" module should run under other UNIX systems as well.