From 21e9f4c6466b884f87ab39d704101fb4b8b9f3c6 Mon Sep 17 00:00:00 2001 From: Zack Drach Date: Fri, 12 Aug 2022 23:17:44 -0700 Subject: [PATCH] [watchmedo] Add SIGHUP termination signals (#912) * add SIGHUP handler to watchmedo * changelog --- changelog.rst | 3 ++- src/watchdog/watchmedo.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/changelog.rst b/changelog.rst index 1d45b13e..b9f4c9df 100644 --- a/changelog.rst +++ b/changelog.rst @@ -10,7 +10,8 @@ Changelog - [documentation] HTML documentation builds are now tested for errors. - [fsevents2] The fsevents2 observer is now deprecated. -- Thanks to our beloved contributors: @kurtmckee +- [watchmedo] Handle shutdown events from ``SIGHUP`` (`#912 `__) +- Thanks to our beloved contributors: @kurtmckee @babymastodon 2.1.9 ~~~~~ diff --git a/src/watchdog/watchmedo.py b/src/watchdog/watchmedo.py index 20d0f772..0ea2ed58 100755 --- a/src/watchdog/watchmedo.py +++ b/src/watchdog/watchmedo.py @@ -610,7 +610,7 @@ def auto_restart(args): # Handle termination signals by raising a semantic exception which will # allow us to gracefully unwind and stop the observer - termination_signals = {signal.SIGTERM, signal.SIGINT} + termination_signals = {signal.SIGTERM, signal.SIGINT, signal.SIGHUP} def handler_termination_signal(_signum, _frame): # Neuter all signals so that we don't attempt a double shutdown