jnrbsn/daemonocle — pull request #5 by nlebedenco (2014-09-21 06:07:22+00:00)
Title: Give the process a chance to close normally

Added Daemon.terminate_callback and changed Daemon._handle_terminate
to first call the terminate_callback and give the process a chance
to close normally. Call _shutdown only when the terminate_callback is not
set or when we have already called it once (meaning it's the second time a
terminating signal arrives)