diff --git a/bin/weewx/engine.py b/bin/weewx/engine.py index 97b300db..5f17ed79 100644 --- a/bin/weewx/engine.py +++ b/bin/weewx/engine.py @@ -949,8 +949,8 @@ def main(options, args, engine_class=StdEngine): except Terminate: log.info("Terminating weewx version %s", weewx.__version__) weeutil.logger.log_traceback(log.info, " **** ") - # Reraise the exception (this should cause the program to exit) - raise + signal.signal(signal.SIGTERM, signal.SIG_DFL) + os.kill(0, signal.SIGTERM) # Catch any keyboard interrupts and log them except KeyboardInterrupt: diff --git a/docs/changes.txt b/docs/changes.txt index bac39f76..1ef91db6 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -134,6 +134,9 @@ Fixes issue #431. Thanks to user ls4096! Fixed problem that can cause an exception with restx services that do not use the database manager. See commit 459ccb1. +Sending a SIGTERM signal to weewxd now causes it to exit with status +128 + signal#. PR #442. Thanks to user sshambar! + 3.9.1 02/06/2019