1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-13 11:32:20 -05:00

Fix for restart issues

This commit is contained in:
echel0n 2014-05-29 02:04:09 -07:00
parent 87c7476907
commit 4a4eec0a9e
2 changed files with 3 additions and 7 deletions

View File

@ -107,7 +107,7 @@ def daemonize():
sys.stderr.write("fork #1 failed: %d (%s)\n" % (e.errno, e.strerror))
sys.exit(1)
os.setsid(pid) # @UndefinedVariable - only available in UNIX
os.setsid() # unix
# Make sure I can read my own files and shut out others
prev = os.umask(0)

View File

@ -1293,7 +1293,6 @@ def saveAll():
def saveAndShutdown(restart=False):
halt()
saveAll()
logger.log(u"Killing cherrypy")
@ -1303,7 +1302,6 @@ def saveAndShutdown(restart=False):
logger.log(u"Removing pidfile " + str(PIDFILE))
remove_pid_file(PIDFILE)
status = 0
if restart:
install_type = versionCheckScheduler.action.install_type
@ -1324,16 +1322,14 @@ def saveAndShutdown(restart=False):
popen_list += MY_ARGS
if '--nolaunch' not in popen_list:
popen_list += ['--nolaunch']
logger.log(u"Restarting SickRage with " + str(popen_list))
logger.close()
subprocess.Popen(popen_list, cwd=os.getcwd())
time.sleep(5)
logger.log(u"SickRage successfully restarted ...")
subprocess.Popen(popen_list, cwd=os.getcwd())
os._exit(0)
def invoke_command(to_call, *args, **kwargs):
global invoked_command