You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					44 lines
				
				1.3 KiB
			
		
		
			
		
	
	
					44 lines
				
				1.3 KiB
			| 
											6 years ago
										 | #!/usr/bin/env python3
 | ||
|  | 
 | ||
|  | import time
 | ||
|  | from multiprocessing import Process
 | ||
|  | 
 | ||
| 
											2 years ago
										 | from openpilot.common.params import Params
 | ||
|  | from openpilot.selfdrive.manager.process import launcher
 | ||
| 
											2 years ago
										 | from openpilot.common.swaglog import cloudlog
 | ||
| 
											2 years ago
										 | from openpilot.system.hardware import HARDWARE
 | ||
| 
											2 years ago
										 | from openpilot.system.version import get_build_metadata
 | ||
| 
											6 years ago
										 | 
 | ||
|  | ATHENA_MGR_PID_PARAM = "AthenadPid"
 | ||
|  | 
 | ||
| 
											5 years ago
										 | 
 | ||
| 
											6 years ago
										 | def main():
 | ||
|  |   params = Params()
 | ||
|  |   dongle_id = params.get("DongleId").decode('utf-8')
 | ||
| 
											2 years ago
										 |   build_metadata = get_build_metadata()
 | ||
|  | 
 | ||
| 
											2 years ago
										 |   cloudlog.bind_global(dongle_id=dongle_id,
 | ||
| 
											2 years ago
										 |                        version=build_metadata.openpilot.version,
 | ||
|  |                        origin=build_metadata.openpilot.git_normalized_origin,
 | ||
|  |                        branch=build_metadata.channel,
 | ||
|  |                        commit=build_metadata.openpilot.git_commit,
 | ||
|  |                        dirty=build_metadata.openpilot.is_dirty,
 | ||
| 
											2 years ago
										 |                        device=HARDWARE.get_device_type())
 | ||
| 
											6 years ago
										 | 
 | ||
|  |   try:
 | ||
|  |     while 1:
 | ||
|  |       cloudlog.info("starting athena daemon")
 | ||
| 
											1 year ago
										 |       proc = Process(name='athenad', target=launcher, args=('system.athena.athenad', 'athenad'))
 | ||
| 
											6 years ago
										 |       proc.start()
 | ||
|  |       proc.join()
 | ||
|  |       cloudlog.event("athenad exited", exitcode=proc.exitcode)
 | ||
|  |       time.sleep(5)
 | ||
| 
											6 years ago
										 |   except Exception:
 | ||
| 
											6 years ago
										 |     cloudlog.exception("manage_athenad.exception")
 | ||
|  |   finally:
 | ||
| 
											3 years ago
										 |     params.remove(ATHENA_MGR_PID_PARAM)
 | ||
| 
											6 years ago
										 | 
 | ||
| 
											5 years ago
										 | 
 | ||
| 
											6 years ago
										 | if __name__ == '__main__':
 | ||
| 
											6 years ago
										 |   main()
 |