Ice Cream Sandwich init.rc documentation
Asked Answered
W

3

6

The behavior of init.*.rc in Ice Cream Sandwich seems to have changed. Previously, I had been able to start a service at boot with an entry like:

service my_kool_service /system/bin/my_kool_service

I did find this post, which gave a hint to change to:

service my_kool_service /system/bin/my_kool_service
    class main

So what is class main, and why is it necessary?

This documentation does talk about the class "option", but provides no details on default behavior, or the observed change.

Is the current ICS init rc language documented anywhere, formally or otherwise?

Thank you.

Wadi answered 21/4, 2012 at 3:18 Comment(1)
can you say me the location of init.rc in ice-cream s/w ?Somerset
P
4

As already been said init.rc is documented in this readme. The class service option is used to group services and start and stop them together respectively with commands class_start and class_stop.

Specifically classes core, main and late_start are used in Android 3.0 onwards for encryption (see section "How Android encryption works" in the Notes on the implementation of encryption in Android 3.0). In particular, quoting that document:

Core services are never shut down after starting. main services are shutdown and then restarted after the disk password is entered. late_start services are not started until after /data has been decrypted and mounted.

Peacoat answered 17/10, 2013 at 9:57 Comment(0)
S
3

If you add a service in a particular class, then you can start the service calling start_class . E.g. If you have 10 services under class test, then by calling start_class test, you can start all 10 services under class test if they are not running already. Same is applicable for stopping all the services also...

See, following link for more details about init.rc language https://github.com/android/platform_system_core/blob/master/init/readme.txt

I hope it will help..:)

Surprising answered 29/6, 2012 at 7:5 Comment(0)
B
1

class core - Always started first and cannot be shut down without serious consequences in most cases class main - Responsible for services. Can be restarted, but only if absolutely required class late-start - Happens right before the full system boots and starts becoming available to the user.

Bodwell answered 17/2, 2016 at 11:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.