Cannot start Glances 3.4.0.1 on Windows 10: SIGHUP not defined #2408

This commit is contained in:
nicolargo 2023-05-18 17:28:11 +02:00
parent 2c5df09983
commit fef2d86940

View File

@ -156,8 +156,13 @@ def main():
Select the mode (standalone, client or server)
Run it...
"""
# SIGHUP not available on Windows (see issue #2408)
if sys.platform.startswith('win'):
signal_list = (signal.SIGTERM, signal.SIGINT)
else:
signal_list = (signal.SIGTERM, signal.SIGINT, signal.SIGHUP)
# Catch the kill signal
for sig in (signal.SIGTERM, signal.SIGINT, signal.SIGHUP):
for sig in signal_list:
signal.signal(sig, __signal_handler)
# Log Glances and psutil version