Browse Source

Correct Windows Service restart

Broke it in the previous commit.
pull/1763/head
Safihre 4 years ago
parent
commit
ee41cfc618
  1. 8
      SABnzbd.py

8
SABnzbd.py

@ -1574,13 +1574,13 @@ def main():
cmd = 'kill -9 %s && open "%s" --args %s' % (os.getpid(), my_name, my_args) cmd = 'kill -9 %s && open "%s" --args %s' % (os.getpid(), my_name, my_args)
logging.info("Launching: %s", cmd) logging.info("Launching: %s", cmd)
os.system(cmd) os.system(cmd)
elif sabnzbd.WIN_SERVICE:
# Use external service handler to do the restart
# Wait 5 seconds to clean up
subprocess.Popen("timeout 5 & sc start SABnzbd", shell=True)
elif sabnzbd.WIN32: elif sabnzbd.WIN32:
# Just a simple restart of the exe # Just a simple restart of the exe
os.execv(sys.executable, ['"%s"' % arg for arg in sys.argv]) os.execv(sys.executable, ['"%s"' % arg for arg in sys.argv])
elif sabnzbd.WIN_SERVICE:
# Use external service handler to do the restart
# Wait 5 seconds to clean up
subprocess.Popen("timeout 5 & sc start SABnzbd", shell=True)
else: else:
# CherryPy has special logic to include interpreter options such as "-OO" # CherryPy has special logic to include interpreter options such as "-OO"
cherrypy.engine._do_execv() cherrypy.engine._do_execv()

Loading…
Cancel
Save