Proper handle of sigterm signal, log reason of shutdown
This commit is contained in:
parent
16f36824e6
commit
faba28dd94
2 changed files with 23 additions and 20 deletions
|
@ -15,12 +15,6 @@ 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)
|
||||
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue