Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix atexit not working on SIGTERM #1882

Merged
merged 3 commits into from
Jan 30, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix atexit not working on SIGTERM
  • Loading branch information
blurHY committed Jan 29, 2019
commit c03cd02eed99d64bcfb14930986e224b1f9a21df
5 changes: 5 additions & 0 deletions zeronet.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ def main():

main = None
try:
import atexit
from signal import signal, SIGTERM

signal(SIGTERM, lambda signum, stack_frame: sys.exit(0))

app_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(app_dir) # Change working dir to zeronet.py dir
sys.path.insert(0, os.path.join(app_dir, "src/lib")) # External liblary directory
Expand Down