Ignore SIGHUP — survive terminal closure in background
__main__.py: add signal.SIGHUP → SIG_IGN before setting up SIGINT/SIGTERM handlers. Sniffer no longer dies when the terminal closes or the shell session ends. README: add Background / Daemon section with nohup examples.
This commit is contained in:
1 parent
ad8d661caa
commit
fb5c1fbf6a
2 files changed
+12
No files matched your search
@@ -131,6 +131,7 @@ def main():
|
||||
file_dumper.close()
|
||||
sys.exit(0)
|
||||
|
||||
signal.signal(signal.SIGHUP, signal.SIG_IGN)
|
||||
signal.signal(signal.SIGINT, on_signal)
|
||||
signal.signal(signal.SIGTERM, on_signal)
|
||||
|
||||
|
||||
Reference in new issue
Block a user