@ -143,6 +143,7 @@ if __name__ == "__main__" and not PREBUILT:
build ( )
build ( )
import cereal . messaging as messaging
import cereal . messaging as messaging
from cereal import log
from common . params import Params
from common . params import Params
from selfdrive . registration import register
from selfdrive . registration import register
@ -165,7 +166,6 @@ managed_processes = {
" tombstoned " : " selfdrive.tombstoned " ,
" tombstoned " : " selfdrive.tombstoned " ,
" logcatd " : ( " selfdrive/logcatd " , [ " ./logcatd " ] ) ,
" logcatd " : ( " selfdrive/logcatd " , [ " ./logcatd " ] ) ,
" proclogd " : ( " selfdrive/proclogd " , [ " ./proclogd " ] ) ,
" proclogd " : ( " selfdrive/proclogd " , [ " ./proclogd " ] ) ,
" boardd " : ( " selfdrive/boardd " , [ " ./boardd " ] ) , # not used directly
" pandad " : " selfdrive.pandad " ,
" pandad " : " selfdrive.pandad " ,
" ui " : ( " selfdrive/ui " , [ " ./ui " ] ) ,
" ui " : ( " selfdrive/ui " , [ " ./ui " ] ) ,
" calibrationd " : " selfdrive.locationd.calibrationd " ,
" calibrationd " : " selfdrive.locationd.calibrationd " ,
@ -462,6 +462,7 @@ def manager_thread():
logger_dead = False
logger_dead = False
params = Params ( )
params = Params ( )
thermal_sock = messaging . sub_sock ( ' thermal ' )
thermal_sock = messaging . sub_sock ( ' thermal ' )
pm = messaging . PubMaster ( [ ' managerState ' ] )
while 1 :
while 1 :
msg = messaging . recv_sock ( thermal_sock , wait = True )
msg = messaging . recv_sock ( thermal_sock , wait = True )
@ -501,6 +502,20 @@ def manager_thread():
running_list = [ " %s %s \u001b [0m " % ( " \u001b [32m " if running [ p ] . is_alive ( ) else " \u001b [31m " , p ) for p in running ]
running_list = [ " %s %s \u001b [0m " % ( " \u001b [32m " if running [ p ] . is_alive ( ) else " \u001b [31m " , p ) for p in running ]
cloudlog . debug ( ' ' . join ( running_list ) )
cloudlog . debug ( ' ' . join ( running_list ) )
# send managerState
states = [ ]
for p in managed_processes :
state = log . ManagerState . ProcessState . new_message ( )
state . name = p
if p in running :
state . running = running [ p ] . is_alive ( )
state . pid = running [ p ] . pid
state . exitCode = running [ p ] . exitcode or 0
states . append ( state )
msg = messaging . new_message ( ' managerState ' )
msg . managerState . processes = states
pm . send ( ' managerState ' , msg )
# Exit main loop when uninstall is needed
# Exit main loop when uninstall is needed
if params . get ( " DoUninstall " , encoding = ' utf8 ' ) == " 1 " :
if params . get ( " DoUninstall " , encoding = ' utf8 ' ) == " 1 " :
break
break