On 05/20/2014 09:58 AM, Ethan Furman wrote:

I suggest that the detach happen after all the prep work is complete, which 
solves most of the above issues.

Well, of course that took more work than just moving a couple lines up.  ;)

I had to break the acquire/write_pid into two steps:

  acquire:  open the file, but leave it empty -- any errors
            with this part will still go the terminal; also
            change the owner of the file to match the final
            uid/gid

  seal:     after detach and pid change, write the new pid
            and close the file

I ended up writing the pid files into /var/tmp since they cannot be deleted from /var/run by the non-privileged user that my daemon ends up running as.

--
~Ethan~

_______________________________________________
python-daemon-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-daemon-devel

Reply via email to