diff options
author | mathieui <mathieui@mathieui.net> | 2014-04-20 17:47:16 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2014-04-20 17:47:16 +0200 |
commit | d66aa8cf66e0bc709cedb06ec855feb0ca238761 (patch) | |
tree | c17efba8fc2ccd4978683ca28295665ba31d790c /src/core | |
parent | 93594b8453626be4e7c620ee2ce1d3529ed8e66c (diff) | |
download | poezio-d66aa8cf66e0bc709cedb06ec855feb0ca238761.tar.gz poezio-d66aa8cf66e0bc709cedb06ec855feb0ca238761.tar.bz2 poezio-d66aa8cf66e0bc709cedb06ec855feb0ca238761.tar.xz poezio-d66aa8cf66e0bc709cedb06ec855feb0ca238761.zip |
Log exit from signals to the error log
(SIGTERM, SIGHUP, and SIGPIPE for now)
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/core.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core/core.py b/src/core/core.py index 4269c409..1fe00d2d 100644 --- a/src/core/core.py +++ b/src/core/core.py @@ -388,12 +388,19 @@ class Core(object): def exit_from_signal(self, *args, **kwargs): """ - Quit when receiving SIGHUP or SIGTERM + Quit when receiving SIGHUP or SIGTERM or SIGPIPE do not save the config because it is not a normal exit (and only roster UI things are not yet saved) """ - log.debug("Either SIGHUP or SIGTERM received. Exiting…") + sig = args[0] + signals = { + 1: 'SIGHUP', + 13: 'SIGPIPE', + 15: 'SIGTERM', + } + + log.error("%s received. Exiting…", signals[sig]) if config.get('enable_user_mood', True): self.xmpp.plugin['xep_0107'].stop(block=False) if config.get('enable_user_activity', True): |