Popular recipes tagged "daemon" but not "application" and "threads"http://code.activestate.com/recipes/tags/daemon-application-threads/popular/2013-10-07T21:03:30-07:00ActiveState Code RecipesContext manager for a daemon pid file (Python)
2013-10-07T21:03:30-07:00Graham Poulterhttp://code.activestate.com/recipes/users/4172291/http://code.activestate.com/recipes/577911-context-manager-for-a-daemon-pid-file/
<p style="color: grey">
Python
recipe 577911
by <a href="/recipes/users/4172291/">Graham Poulter</a>
(<a href="/recipes/tags/daemon/">daemon</a>, <a href="/recipes/tags/pid/">pid</a>).
Revision 3.
</p>
<p>Context manager for a pid (process id) file used to tell whether a daemon process is still running.</p>
<p>On entry, it writes the pid of the current process to the path. On exit, it removes the file.</p>
<p>Designed to work with python-daemon.</p>
logging support for python daemon (Python)
2010-10-25T15:22:18-07:00Bud P. Brueggerhttp://code.activestate.com/recipes/users/4175472/http://code.activestate.com/recipes/577442-logging-support-for-python-daemon/
<p style="color: grey">
Python
recipe 577442
by <a href="/recipes/users/4175472/">Bud P. Bruegger</a>
(<a href="/recipes/tags/daemon/">daemon</a>, <a href="/recipes/tags/logging/">logging</a>).
</p>
<p>The recipe shows how to subclass python-daemon's [1] DaemonContext to add logging support. In particular, it is possible to ask to keep the files related to a list of loggers (loggers_preserve) open and to redirect stdout and stderr to a logger (e.g., one using a RotatingFileHandler). </p>
<p>[1] See <a href="http://pypi.python.org/pypi/python-daemon/" rel="nofollow">http://pypi.python.org/pypi/python-daemon/</a></p>