arnaudsj/python-daemon — pull request #2 by banyek (2014-03-13 15:39:38+00:00)
Title: Switched to a+ from w+ in stderr and and stdout open mode

Hi!

I have use the daemon and I like it, but I found a small problem in that.
When I set the stderr and stdout to files for logging, every daemon restart empties the logfile.
When I was digged myself to the code I found the following lines in runner.py

self.daemon_context.stdout = open(app.stdout_path, 'w+')
self.daemon_context.stderr = open(
app.stderr_path, 'w+', buffering=0)

I think to switch this w+ open modes to a+ will easily solve this problem.
I was tested it, it didn't cause any trouble even when using '/dev/tty'