Closed nnathan closed 9 years ago
You inferred the correct case, I like the third approach best. Let me fix up the code (after testing the TERM handler) and push then let's reevaluate the PR.
trbs, thanks for the feedback. I've implemented the suggested changes:
(1) use the logger property to automatically setup a logging instance (and clean up close()
),
(2) remove the term_signal_handler
you introduced, I didn't really see the obvious solution was to simply set the register_term_signal_handler=False
. I was very confused by the TERM signal handler because I'm not quite familiar with atexit()
, but now I understand the intentions when implementing this option.
Nice !
In relation to https://github.com/trbs/pid/issues/4.
The following PR is a culmination of fixing the following issue:
I made a test and the appropriate fix to support double lazy checks. I then tried the testsuite defaulting
lazy=True
and that also worked. Furthermore, I moved thelogging
to the_setup()
phase, because we cannot make assumptions whether the internal logging stream handle would be available after daemonization. It isn't elegant but I beleive it is the correct approach when combiningpid
with a daemon manager.