[Netfilter] only perform cleanup at exit if SIGTERM was recieved
This commit is contained in:
parent
b236fd3ac6
commit
2072301d89
@ -376,6 +376,11 @@ def quit(signum, frame):
|
|||||||
global quit_now
|
global quit_now
|
||||||
quit_now = True
|
quit_now = True
|
||||||
|
|
||||||
|
def quit_clear(signum, frame):
|
||||||
|
global exit_code
|
||||||
|
clear()
|
||||||
|
sys.exit(exit_code)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# init Logger
|
# init Logger
|
||||||
@ -474,8 +479,7 @@ if __name__ == '__main__':
|
|||||||
whitelistupdate_thread.daemon = True
|
whitelistupdate_thread.daemon = True
|
||||||
whitelistupdate_thread.start()
|
whitelistupdate_thread.start()
|
||||||
|
|
||||||
signal.signal(signal.SIGTERM, quit)
|
signal.signal(signal.SIGTERM, quit_clear)
|
||||||
atexit.register(clear)
|
|
||||||
|
|
||||||
while not quit_now:
|
while not quit_now:
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
|
Loading…
Reference in New Issue
Block a user