Merge pull request #462 from jackwilsdon/fix-restart-dev
Use os.execv instead of subprocess.Popen to restart the process
This commit is contained in:
@@ -812,12 +812,13 @@ def shutdown(restart=False, update=False):
|
|||||||
|
|
||||||
if restart:
|
if restart:
|
||||||
logger.info('PlexPy is restarting...')
|
logger.info('PlexPy is restarting...')
|
||||||
popen_list = [sys.executable, FULL_PATH]
|
exe = sys.executable
|
||||||
popen_list += ARGS
|
args = [exe, FULL_PATH]
|
||||||
if '--nolaunch' not in popen_list:
|
args += ARGS
|
||||||
popen_list += ['--nolaunch']
|
if '--nolaunch' not in args:
|
||||||
logger.info('Restarting PlexPy with %s', popen_list)
|
args += ['--nolaunch']
|
||||||
subprocess.Popen(popen_list, cwd=os.getcwd())
|
logger.info('Restarting PlexPy with %s', args)
|
||||||
|
os.execv(exe, args)
|
||||||
|
|
||||||
os._exit(0)
|
os._exit(0)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user