Browse Source

Shutdown parentmonitor

pull/84/head
Ruud 13 years ago
parent
commit
956799b863
  1. 9
      couchpotato/core/_base/_core/main.py

9
couchpotato/core/_base/_core/main.py

@ -19,7 +19,7 @@ log = CPLog(__name__)
class Core(Plugin):
ignore_restart = ['Core.crappyRestart', 'Core.crappyShutdown', 'Core.monitorParent']
ignore_restart = ['Core.crappyRestart', 'Core.crappyShutdown']
shutdown_started = False
def __init__(self):
@ -39,15 +39,20 @@ class Core(Plugin):
self.removeRestartFile()
def monitorParent(self):
while 1:
do_shutdown = False
while 1 and not self.shuttingDown():
if os.name == 'nt':
if os.getppid(os.getpid()) <= 1:
do_shutdown = True
break
else:
if os.getppid() <= 1:
do_shutdown = True
break
time.sleep(1)
if do_shutdown:
log.info('Starterscript has shutdown, shutdown subprocess')
fireEvent('app.crappy_shutdown')

Loading…
Cancel
Save