Let me first say that pyramid has made writing cli scripts a breeze with
pyramid.paster.bootstrap(). I love it!
I am looking to turn some of my scripts into daemon processes. I went to
look at how pserve does this, and I noticed that it is not a trivial piece
of code. It seems to me that it would be incredibly useful to add a
daemonize function that mimics (and slightly builds upon) the behavior seen
in pserve so as to make it easy to developers.
I am imagining an interface that looks something like:
or, more cleanly(?)
Potential additional enhancements would be to specify the signals used for
stop, restart, and reload. I think that these can exist as standalone
functions, or, alternatively, it would be easy enough to make a callable
DaemonCommand base class. Thoughts?