Skip to content

Commit cce6a9d

Browse files
committed
firewall.py: catch SIGINT and SIGTERM too.
There were still a few conditions under some OSes that would cause firewall.py to terminate without cleaning up the firewall settings. 'pkill sshuttle' was one of them. Ignore a couple more signals to further ensure a correct cleanup. (This only affects sshuttle --firewall, which is a subprocess of the main sshuttle process. The firewall is supposed to exit automatically whenever the client exits, and so far that part seems to work reliably.)
1 parent 5743f29 commit cce6a9d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

firewall.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,8 @@ def main(port, dnsport, syslog):
471471
# disappears; we still have to clean up.
472472
signal.signal(signal.SIGHUP, signal.SIG_IGN)
473473
signal.signal(signal.SIGPIPE, signal.SIG_IGN)
474+
signal.signal(signal.SIGTERM, signal.SIG_IGN)
475+
signal.signal(signal.SIGINT, signal.SIG_IGN)
474476

475477
# ctrl-c shouldn't be passed along to me. When the main sshuttle dies,
476478
# I'll die automatically.

0 commit comments

Comments
 (0)