From ee41cfc618b7e1d1709df32a003ca2def41b266c Mon Sep 17 00:00:00 2001 From: Safihre Date: Thu, 21 Jan 2021 20:58:00 +0100 Subject: [PATCH] Correct Windows Service restart Broke it in the previous commit. --- SABnzbd.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SABnzbd.py b/SABnzbd.py index c10f7c2..f7e7b9e 100755 --- a/SABnzbd.py +++ b/SABnzbd.py @@ -1574,13 +1574,13 @@ def main(): cmd = 'kill -9 %s && open "%s" --args %s' % (os.getpid(), my_name, my_args) logging.info("Launching: %s", 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: # Just a simple restart of the exe 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: # CherryPy has special logic to include interpreter options such as "-OO" cherrypy.engine._do_execv()