On Fri, 20 Mar 2009 20:58:58 +1100, Ben Finney <ben+pyt...@benfinney.id.au>
wrote:
Ben Finney <b...@benfinney.id.au> writes:
Writing a Python program to become a Unix daemon is relatively
well-documented: there's a recipe for detaching the process and
running in its own process group. However, there's much more to a
Unix daemon than simply detaching.
[…]
My searches for such functionality haven't borne much fruit though.
Apart from scattered recipes, none of which cover all the essentials
(let alone the optional features) of 'daemon', I can't find anything
that could be relied upon. This is surprising, since I'd expect this
in Python's standard library.
I've submitted PEP 3143 <URL:http://www.python.org/dev/peps/pep-3143/>
to meet this need, and have re-worked an existing library into a new
‘python-daemon’ <URL:http://pypi.python.org/pypi/python-daemon/>
library, the reference implementation.
Now I need wider testing and scrutiny of the implementation and
specification.
The biggest shortcoming seems to be a complete lack of unit tests. A
quick skim of the code suggests that part of it don't even work at all
and have never been tested, even interactively, since they must surely
fail. For example, uid/gid setting is broken.
I'd recommend adding an automated test suite, fixing all the issues that
come up during that process, and then asking for scrutiny again.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list