<div dir="ltr"><div>hey all,<br><br></div><div>i have written a implementation of pep 3143, that will work with python 2 and 3<br><br>It contains a PidFile Class that only depends on build in modules.<br><br></div><div>i have also written some unit and integration tests, currently they depend on python 3.3 because of the use of unittest.mock. and i think i will have to add some more tests later.<br>
<br></div><div>the only external dependency is the six package.<br></div><div><br></div><div>i tried to stick as close as possible to the PEP, but there where some parts where i felt that they make no sense.<br><br></div>
<div>for example the DaemonContext.close() method is a dummy function. because there is no sane way to close a daemon, except doing clean-ups and calling sys.exit(). But it is there, and if anyone like, it could be subclassed and overwritten.<br>
<br></div><div>i also dropped the atexit stuff from the open() method. I moved this into my PidFile class.<br><br></div><div>here is my initial commit on GitHub:<br><br><a href="https://github.com/schlitzered/pep-3143-daemon">https://github.com/schlitzered/pep-3143-daemon</a><br>
<br></div><div>this is a quite early state, but it should do everything that is needed for turning a process into a daemon.<br><br></div><div>feel free to test this, and send me some feedback.<br><br></div><div>cheers<br>
<br></div><div>stephan<br></div></div>