mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Merge pull request #1076 from Vashypooh/master
Added support for windows service
This commit is contained in:
commit
665a6435ef
2 changed files with 13 additions and 4 deletions
|
@ -54,6 +54,7 @@ VERBOSE = True
|
|||
DAEMON = False
|
||||
CREATEPID = False
|
||||
PIDFILE = None
|
||||
WINDOWSSERVICE = False
|
||||
|
||||
SCHED = BackgroundScheduler()
|
||||
SCHED_LOCK = threading.Lock()
|
||||
|
@ -989,15 +990,17 @@ def shutdown(restart=False, update=False):
|
|||
args += ARGS
|
||||
if '--nolaunch' not in args:
|
||||
args += ['--nolaunch']
|
||||
logger.info('Restarting PlexPy with %s', args)
|
||||
|
||||
# os.execv fails with spaced names on Windows
|
||||
# https://bugs.python.org/issue19066
|
||||
if os.name == 'nt':
|
||||
if os.name == 'nt' and plexpy.WINDOWSSERVICE:
|
||||
logger.info("Running as windows service, no need to fork.")
|
||||
elif os.name == 'nt':
|
||||
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._exit(0)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue