[MERGE] 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-20130107174846-745eqpvp2lhskspi
This commit is contained in:
Xavier ALT 2013-01-07 18:48:46 +01:00
commit 475d2ec5b4
1 changed files with 1 additions and 1 deletions

View File

@ -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[:]