3

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
Mr_and_Mrs_D
  • 32,208
  • 39
  • 178
  • 361
Da Ha Song
  • 398
  • 5
  • 11
  • What do you mean by System services ? The linux services or the programmatically accessible Android services ? The latter are taken in charge lazily by Zygote. – Snicolas Nov 18 '13 at 06:57
  • @Snicolas When I said system services, I meant native daemons like servicemanager, vold, adbd, etc. which are not started in zygote – Da Ha Song Nov 18 '13 at 20:48
  • You right, they must be started by the underlying of the linux system. Sorry I can't help on that. – Snicolas Nov 18 '13 at 21:19

1 Answers1

8

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.

Da Ha Song
  • 398
  • 5
  • 11