From 44d536d40d8886b9673753848aaf68ae526e638b Mon Sep 17 00:00:00 2001 From: Xavier ALT Date: Mon, 7 Jan 2013 17:23:02 +0100 Subject: [PATCH] [FIX] win32: use 'net' command for service start/stop operation * We have to wait for complete service stop before trying to re-start OpenERP service, otherwise service manager will complain that the service is already running - and thus preventing to it start. 'sc' command only send a query to service manager without waiting for completion - instead we use 'net' command which wait for complete start/stop operation. bzr revid: xal@openerp.com-20130107162302-xtf44nm10859203w --- openerp/service/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/service/__init__.py b/openerp/service/__init__.py index 307ee4a6526..c95e35d8252 100644 --- a/openerp/service/__init__.py +++ b/openerp/service/__init__.py @@ -130,7 +130,7 @@ def start_services_workers(): def _reexec(): """reexecute openerp-server process with (nearly) the same arguments""" if openerp.tools.osutil.is_running_as_nt_service(): - subprocess.call('sc stop {0} && sc start {0}'.format(nt_service_name), shell=True) + subprocess.call('net stop {0} && net start {0}'.format(nt_service_name), shell=True) exe = os.path.basename(sys.executable) strip_args = ['-d', '-u'] a = sys.argv[:]