[FIX] correct reexecute. works for windows service
bzr revid: chs@openerp.com-20121205175630-6y8ul4ki13z0coyh
This commit is contained in:
parent
097254fe00
commit
effec78db7
|
@ -23,6 +23,7 @@
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import signal
|
import signal
|
||||||
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
@ -34,6 +35,7 @@ import openerp.cron
|
||||||
import openerp.modules
|
import openerp.modules
|
||||||
import openerp.netsvc
|
import openerp.netsvc
|
||||||
import openerp.osv
|
import openerp.osv
|
||||||
|
from openerp.release import nt_service_name
|
||||||
import openerp.tools
|
import openerp.tools
|
||||||
import openerp.service.wsgi_server
|
import openerp.service.wsgi_server
|
||||||
|
|
||||||
|
@ -132,7 +134,7 @@ def start_services_workers():
|
||||||
def _reexec():
|
def _reexec():
|
||||||
"""reexecute openerp-server process with (nearly) the same arguments"""
|
"""reexecute openerp-server process with (nearly) the same arguments"""
|
||||||
if openerp.tools.osutil.is_running_as_nt_service():
|
if openerp.tools.osutil.is_running_as_nt_service():
|
||||||
os.abort()
|
subprocess.call('sc stop {0} && sc start {0}'.format(nt_service_name), shell=True)
|
||||||
exe = os.path.basename(sys.executable)
|
exe = os.path.basename(sys.executable)
|
||||||
strip_args = ['-d', '-u']
|
strip_args = ['-d', '-u']
|
||||||
a = sys.argv[:]
|
a = sys.argv[:]
|
||||||
|
|
Loading…
Reference in New Issue