mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-05 23:01:15 +02:00
Builtin destination to shutdown the server.
This commit is contained in:
1 parent
ab02925f98
commit
a92da02973
5 files changed
+15
No files matched your search
@@ -107,6 +107,9 @@ class Server(object):
|
||||
# instance.start() # starts the new process
|
||||
#=======================================================================
|
||||
|
||||
# special built-in destination to stop the server
|
||||
JSONRPCWebSocket.register_destination("builtin.stop", self._cleanup)
|
||||
|
||||
for module in MODULES:
|
||||
instance = module(module.__name__.lower(),
|
||||
"127.0.0.1", # ZeroMQ server address
|
||||
@@ -151,6 +154,8 @@ class Server(object):
|
||||
signals = [signal.SIGTERM, signal.SIGINT]
|
||||
if not sys.platform.startswith("win"):
|
||||
signals.extend([signal.SIGHUP, signal.SIGQUIT])
|
||||
else:
|
||||
signals.extend([signal.SIGBREAK])
|
||||
for sig in signals:
|
||||
signal.signal(sig, signal_handler)
|
||||
|
||||
|
||||
Reference in new issue
Block a user