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:
catarrh committed 2026-08-11 00:37:41 +03:00
1 parent ad8d661caa
commit fb5c1fbf6a
2 files changed
+12

No files matched your search

+11
View File
@@ -129,6 +129,17 @@ Non-TPDU messages (ATR, PPS, card state changes, Fi/Di) print identically in all
- **GSMTAP**: ATR (subtype 1) and TPDU (subtype 2) over UDP to Wireshark
- **PCAP**: all messages as GSMTAP-encapsulated packets (LINKTYPE 155), openable in Wireshark
## Background / Daemon
SIGHUP is ignored by default — terminal closure won't kill the sniffer.
To run persistently in the background with output to files:
```sh
nohup ./sniff-start.sh --output /tmp/sniff.log &> /tmp/sniff-err.log &
# or
FORMAT=timestamp nohup python -m simtrace2_pysniff --output /tmp/sniff.log &> /tmp/sniff-err.log &
```
## Library Usage
```python