Skip to content

Commit

Permalink
Make sigterm listen optional (fixes macOS problem)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcutme committed Feb 16, 2019
1 parent 952a1a1 commit c92c840
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions zeronet.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ def main():
main = None
try:
import signal
try:
signal.signal(signal.SIGTERM, lambda signum, stack_frame: sys.exit(0))
except Exception as err:
print("Error setting up SIGTERM watcher: %s" % err)

signal.signal(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

0 comments on commit c92c840

Please sign in to comment.