Catch SIGTERM, SIGINT, SIGHUP and SIGQUIT to properly shutdown the

server.
This commit is contained in:
grossmj committed 2013-12-06 17:52:16 -07:00
1 parent 2f23a092e3
commit 798f0367b9
3 files changed
+10 -1

No files matched your search

+1 -1
View File
@@ -15,5 +15,5 @@ def server(request):
server_script = os.path.join(cwd, "../gns3server/main.py")
process = subprocess.Popen([sys.executable, server_script, "--port=8000"])
time.sleep(0.1) # give some time for the process to start
request.addfinalizer(process.kill)
request.addfinalizer(process.terminate)
return process