diff options
author | Jonathan Weth <git@jonathanweth.de> | 2021-06-28 12:56:45 +0200 |
---|---|---|
committer | Jonathan Weth <git@jonathanweth.de> | 2021-06-28 12:56:45 +0200 |
commit | d8146354959fb352f9709ae0d2a674c361dbec17 (patch) | |
tree | 0f3ac1b4ba6142b76ecdc30a8f45a94627e4c30a | |
parent | 3712174c2d02b4a629e7ce0cbb7e8d3bd502d36b (diff) | |
parent | 0874724d59f297518424dee96f26bdaa000faa08 (diff) | |
download | RWA.Support.SessionService-d8146354959fb352f9709ae0d2a674c361dbec17.tar.gz RWA.Support.SessionService-d8146354959fb352f9709ae0d2a674c361dbec17.tar.bz2 RWA.Support.SessionService-d8146354959fb352f9709ae0d2a674c361dbec17.zip |
Merge branch 'master' of gitlab.das-netzwerkteam.de:remotewebapp/rwa.support.sessionservice
-rwxr-xr-x | rwa/support/sessionservice/service.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/rwa/support/sessionservice/service.py b/rwa/support/sessionservice/service.py index a6e6aa1..c69c049 100755 --- a/rwa/support/sessionservice/service.py +++ b/rwa/support/sessionservice/service.py @@ -251,11 +251,16 @@ class RWASupportSessionService(dbus.service.Object): return False def _stop_all(self): - """Stop all sessions and this daemon.""" - logging.info("Stop all sessions and exit service.") + """Stop all sessions""" + logging.info("Stop all sessions.") for session in list(self.sessions.values()): session.stop() del self.sessions[session.pid] + + def _stop_daemon(self): + """Stop all sessions and this daemon.""" + logging.info("Shut down session service.") + self._stop_all() self.trigger_service.shutdown() self.loop.quit() @@ -317,11 +322,16 @@ def main(mockup, once): loop = GLib.MainLoop() service_object = RWASupportSessionService(loop, mockup, once) - def signal_handler(sig, frame): + def sigint_handler(sig, frame): logging.info("Service was terminated.") + service_object._stop_daemon() + + def sigquit_handler(sig, frame): + logging.info("Session was terminated.") service_object._stop_all() - signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGINT, sigint_handler) + signal.signal(signal.SIGQUIT, sigquit_handler) loop.run() |