self.ioThread.daemon=True# thread dies with the program
self.ioThread.start()
...
...
@@ -2044,30 +2059,36 @@ class SvcManager:
self.status=MainExec.STATUS_STARTING
# wait for service to start
foriinrange(0,10):
foriinrange(0,10):
time.sleep(1.0)
self._procIpcBatch()# pump messages
print("_zz_",end="",flush=True)
ifself.status==MainExec.STATUS_RUNNING:
ifself.status==MainExec.STATUS_RUNNING:
print("TDengine service READY to process requests")
return# now we've started
raiseRuntimeError("TDengine service did not start successfully")# TODO: handle this better?
# TODO: handle this better?
raiseRuntimeError("TDengine service did not start successfully")
defstopTaosService(self):
# can be called from both main thread or signal handler
print("Terminating TDengine service running as the sub process...")
# Linux will send Control-C generated SIGINT to the TDengine process already, ref: https://unix.stackexchange.com/questions/176235/fork-and-how-signals-are-delivered-to-processes
ifnotself.subProcess:
# Linux will send Control-C generated SIGINT to the TDengine process