Where are the Android system services started?

我的未来我决定 提交于 2019-12-13 14:14:46

问题


In the book Embedded Android, it says

In init.rc, only an action results in the execution of commands. Service declarations only serve to describe services, they do not actually start anything... (page 246).

So, where are the Android system services (e.g., servicemanager, vold) started? I thought they were started in init.rc by the following lines. But according to the book, I was wrong.

service servicemanager \/system/bin/servicemanager

service vold /system/bin/vold

回答1:


I found the answer.

The statement "Service declarations only serve to describe services, they do not actually start anything" is correct. The native daemons are actually started in init.rc by following lines: (lines 371-372 in https://android.googlesource.com/platform/system/core/+/master/rootdir/init.rc)

  • class_start core
  • class_start main

where all daemons that belong to class core and class main are started respectively.



来源:https://stackoverflow.com/questions/20041794/where-are-the-android-system-services-started

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!