Bugfix in the NT Service
bzr revid: stephane@tinyerp.com-20081013213045-as7jsps8tvbrkv4s
This commit is contained in:
parent
dd13d1a1d5
commit
262ca045db
|
@ -73,15 +73,13 @@ class OpenERPServerService(win32serviceutil.ServiceFramework):
|
||||||
|
|
||||||
|
|
||||||
def StartTERP(self):
|
def StartTERP(self):
|
||||||
# The server finds now its configuration automatically on Windows
|
# The server finds now its configuration automatically on Windows
|
||||||
# We start the ERP Server as an independent process, but we keep its handle
|
# We start the ERP Server as an independent process, but we keep its handle
|
||||||
# The server's binary must be one directory above the service's binary (when py2exe'd the python libraries shouldn' mix)
|
# The server's binary must be one directory above the service's binary (when py2exe'd the python libraries shouldn' mix)
|
||||||
service_dir = os.path.dirname(sys.argv[0])
|
service_dir = os.path.dirname(sys.argv[0])
|
||||||
server_dir = os.path.split(service_dir)[0]
|
server_dir = os.path.split(service_dir)[0]
|
||||||
server_path = os.path.join(server_dir, 'openerp-server.exe')
|
server_path = os.path.join(server_dir, 'openerp-server.exe')
|
||||||
self.terpprocess = subprocess.Popen([server_path], \
|
self.terpprocess = subprocess.Popen([server_path], cwd=server_dir, creationflags=win32process.CREATE_NO_WINDOW)
|
||||||
cwd=server_dir,
|
|
||||||
creationflags=win32process.CREATE_NO_WINDOW)
|
|
||||||
|
|
||||||
|
|
||||||
def StartControl(self,ws):
|
def StartControl(self,ws):
|
||||||
|
@ -93,13 +91,13 @@ class OpenERPServerService(win32serviceutil.ServiceFramework):
|
||||||
# Start OpenERP Server itself
|
# Start OpenERP Server itself
|
||||||
self.StartTERP()
|
self.StartTERP()
|
||||||
# start the loop waiting for the Service Manager's stop signal
|
# start the loop waiting for the Service Manager's stop signal
|
||||||
thread.start_new_thread(self.StartControl, (self.hWaitStop,))
|
thread.start_new_thread(self.StartControl, (self.hWaitStop,))
|
||||||
# Log a info message that the server is running
|
# Log a info message that the server is running
|
||||||
servicemanager.LogInfoMsg("OpenERP Server up and running")
|
servicemanager.LogInfoMsg("OpenERP Server up and running")
|
||||||
# verification if the server is really running, else quit with an error
|
# verification if the server is really running, else quit with an error
|
||||||
self.terpprocess.wait()
|
self.terpprocess.wait()
|
||||||
if not self.stopping:
|
if not self.stopping:
|
||||||
sys.exit("OpenERP Server check: server not running, check the logfile for more info")
|
sys.exit("OpenERP Server check: server not running, check the logfile for more info")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue