Shutdown parentmonitor
This commit is contained in:
1 parent
21105d324e
commit
956799b863
1 file changed
+9
-4
@@ -19,7 +19,7 @@ log = CPLog(__name__)
|
|||||||
|
|
||||||
class Core(Plugin):
|
class Core(Plugin):
|
||||||
|
|
||||||
ignore_restart = ['Core.crappyRestart', 'Core.crappyShutdown', 'Core.monitorParent']
|
ignore_restart = ['Core.crappyRestart', 'Core.crappyShutdown']
|
||||||
shutdown_started = False
|
shutdown_started = False
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@@ -39,17 +39,22 @@ class Core(Plugin):
|
|||||||
self.removeRestartFile()
|
self.removeRestartFile()
|
||||||
|
|
||||||
def monitorParent(self):
|
def monitorParent(self):
|
||||||
while 1:
|
|
||||||
|
do_shutdown = False
|
||||||
|
while 1 and not self.shuttingDown():
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
if os.getppid(os.getpid()) <= 1:
|
if os.getppid(os.getpid()) <= 1:
|
||||||
|
do_shutdown = True
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
if os.getppid() <= 1:
|
if os.getppid() <= 1:
|
||||||
|
do_shutdown = True
|
||||||
break
|
break
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
log.info('Starterscript has shutdown, shutdown subprocess')
|
if do_shutdown:
|
||||||
fireEvent('app.crappy_shutdown')
|
log.info('Starterscript has shutdown, shutdown subprocess')
|
||||||
|
fireEvent('app.crappy_shutdown')
|
||||||
|
|
||||||
def md5Password(self, value):
|
def md5Password(self, value):
|
||||||
return md5(value) if value else ''
|
return md5(value) if value else ''
|
||||||
|
|||||||
Reference in new issue
Block a user