Skip to content

Commit

Permalink
service.py: added status logging when service shuts down
Browse files Browse the repository at this point in the history
  • Loading branch information
trey0 committed Nov 25, 2012
1 parent 7d41e60 commit 5b816b6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions geocamPycroraptor2/service.py
Expand Up @@ -172,8 +172,10 @@ def isStartable(self):
return statuslib.isStartable(self._status)

def _stopInternal(self):
self._eventLogger.warning('received stop command, sending SIGTERM signal')
self._proc.send_signal(signal.SIGTERM)
gevent.sleep(5)
self._eventLogger.warning('service did not stop after first attempt, sending SIGKILL signal')
self._proc.send_signal(signal.SIGKILL)

def _setStatus(self, statusDict):
Expand Down Expand Up @@ -202,6 +204,8 @@ def _cleanup(self):
procStatus=statuslib.CLEAN_EXIT,
returnValue=0)
self._setStatus(newStatus)
self._eventLogger.warning('stopped')
self._eventLogger.warning('status: %s', newStatus)
self._postExitCleanup()
self._proc = None

Expand Down

0 comments on commit 5b816b6

Please sign in to comment.