Skip to content

Commit

Permalink
Cannot start Glances 3.4.0.1 on Windows 10: SIGHUP not defined #2408
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolargo committed May 18, 2023
1 parent 2c5df09 commit fef2d86
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion glances/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fef2d86

Please sign in to comment.