What's the difference between the name and the pathname of a service in Android's init.rc?

85 Views Asked by At

Under Android, in the file /init.rc, there is a line as follows:

service zygote /system/bin/app_process -Xzygote /system/bin ...

According to the documentaion on init.rc's syntax, services should take the form of:

service <name> <pathname> [ <argument> ]*
   <option>
   <option>
   ...

Why is the service name different from the executable name of pathname?

1

There are 1 best solutions below

0
On

The service name is independent from it's executable because an executable can do different things based on it's arguments.

For example you could have 2 different services running the same executable but with different arguments.

NOTE: Take care that the service name is only allowed to be max. 16 characters long.