mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-14 02:26:58 -07:00
Add no forking option to startup arguments
This commit is contained in:
parent
665a6435ef
commit
464fa1f8a3
2 changed files with 10 additions and 9 deletions
|
@ -54,7 +54,7 @@ VERBOSE = True
|
|||
DAEMON = False
|
||||
CREATEPID = False
|
||||
PIDFILE = None
|
||||
WINDOWSSERVICE = False
|
||||
NOFORK = False
|
||||
|
||||
SCHED = BackgroundScheduler()
|
||||
SCHED_LOCK = threading.Lock()
|
||||
|
@ -993,14 +993,15 @@ def shutdown(restart=False, update=False):
|
|||
|
||||
# os.execv fails with spaced names on Windows
|
||||
# https://bugs.python.org/issue19066
|
||||
if os.name == 'nt' and plexpy.WINDOWSSERVICE:
|
||||
logger.info("Running as windows service, no need to fork.")
|
||||
if NOFORK:
|
||||
logger.info('Running as service, not forking. Exiting...')
|
||||
elif os.name == 'nt':
|
||||
logger.info('Restarting PlexPy with %s', args)
|
||||
subprocess.Popen(args, cwd=os.getcwd())
|
||||
logger.info('Restarting PlexPy with %s', args)
|
||||
else:
|
||||
os.execv(exe, args)
|
||||
logger.info('Restarting PlexPy with %s', args)
|
||||
os.execv(exe, args)
|
||||
|
||||
os._exit(0)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue