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