I'm looking for the equivalent of a rc0.d script to take down Android in a clean way so that it can be restarted. In my usecase, Android is running within a jailed chroot for reasons I can't go into great detail about. However, I would like the ability to essentially kill all of the Android services and relaunch on command.
I cannot/will not be using the standard Android dialogs for much and don't want to use the power-off dialog or anything.
I have done some searches and they've all lead me to the ShutdownThread.java file which sends the INTENT_SHUTDOWN to stop a couple of services and then either reboots or shuts down the phone. I only want the first part with no action taken on the device itself (not that it would do much in my case anyway)..