NAMD / pypelinin

Python library to distribute jobs and pipelines among a cluster
3 stars 5 forks source link

Run daemons as actually Unix daemons #60

Open turicas opened 11 years ago

turicas commented 11 years ago

Currently, the "daemons" Router, Broker and Pipeliner actually are not real Unix daemons, since they don't fork, get new session ID and do other things real daemons do.

We should create some helper function/class/whatever to easily run these long-running processes as daemons.

Possible implementations

python-daemon library

PEP 3143 describes a standard-library package to be used as a daemon (Python3-only) and the package python-daemon (Python2), that's available on PyPI, implements it. I personally didn't like its API and probably it'll limit some features we are planning since it always exit parent process right after forking (so we can't, for example, spawn 3 daemons from the same parent process, as we are planning to do on pypelinin command-line interface -- see more at #44 ). Its developers also do not answer the mail list.

home-made

It's not that hard to create a daemon, we just need to follow some steps, so probably the most flexible way is to implement it from the scratch. We can start off from daemonize implementation that is pretty simple.