diff options
| author | Stephane Wirtel <stephane@tinyerp.com> | 2008-10-13 23:30:45 +0200 |
|---|---|---|
| committer | Stephane Wirtel <stephane@tinyerp.com> | 2008-10-13 23:30:45 +0200 |
| commit | 262ca045dbaef82145f04cc8ee8db4582bce9c5f (patch) | |
| tree | 835bd7972c7061fc893641c22a39fc9530386896 /win32 | |
| parent | dd13d1a1d5b93a666df045b10c9940b72b63fdb9 (diff) | |
Bugfix in the NT Service
bzr revid: stephane@tinyerp.com-20081013213045-as7jsps8tvbrkv4s
Diffstat (limited to 'win32')
| -rw-r--r-- | win32/OpenERPServerService.py | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/win32/OpenERPServerService.py b/win32/OpenERPServerService.py index 85cd884a839..f6f071bc082 100644 --- a/win32/OpenERPServerService.py +++ b/win32/OpenERPServerService.py @@ -73,15 +73,13 @@ class OpenERPServerService(win32serviceutil.ServiceFramework): def StartTERP(self):
- # The server finds now its configuration automatically on Windows
- # 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)
- service_dir = os.path.dirname(sys.argv[0])
- server_dir = os.path.split(service_dir)[0]
- server_path = os.path.join(server_dir, 'openerp-server.exe')
- self.terpprocess = subprocess.Popen([server_path], \
- cwd=server_dir,
- creationflags=win32process.CREATE_NO_WINDOW)
+ # The server finds now its configuration automatically on Windows
+ # 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)
+ service_dir = os.path.dirname(sys.argv[0])
+ server_dir = os.path.split(service_dir)[0]
+ server_path = os.path.join(server_dir, 'openerp-server.exe')
+ self.terpprocess = subprocess.Popen([server_path], cwd=server_dir, creationflags=win32process.CREATE_NO_WINDOW)
def StartControl(self,ws):
@@ -93,13 +91,13 @@ class OpenERPServerService(win32serviceutil.ServiceFramework): # Start OpenERP Server itself
self.StartTERP()
# start the loop waiting for the Service Manager's stop signal
- thread.start_new_thread(self.StartControl, (self.hWaitStop,))
- # Log a info message that the server is running
- servicemanager.LogInfoMsg("OpenERP Server up and running")
- # verification if the server is really running, else quit with an error
- self.terpprocess.wait()
- if not self.stopping:
- sys.exit("OpenERP Server check: server not running, check the logfile for more info")
+ thread.start_new_thread(self.StartControl, (self.hWaitStop,))
+ # Log a info message that the server is running
+ servicemanager.LogInfoMsg("OpenERP Server up and running")
+ # verification if the server is really running, else quit with an error
+ self.terpprocess.wait()
+ if not self.stopping:
+ sys.exit("OpenERP Server check: server not running, check the logfile for more info")
|
