I just want to share this information. Some people who are familiar with the initialization scripts in Linux may be confused when they try to find their counterpart in the android directory tree (in the /etc/ folder). Initialization is done in one file, the init.rc which is found in the top level directory /. It is not programmed with bash, it is programmed with Android Init Language. This website describes the syntax for the android init language: http://www.kandroid.org/android_pdk/bring_up.html

This file cannot be modified just by editing it inside the android device, because it is loaded from the ramdisk.img. So you have to edit the file inside your android source code, build the source, then download the image to the ramdisk address of the device.

Also by the way, if you have a shell script (like myscript.sh) and you want to invoke it in the init.rc, you have to add /bin/sh before it like in the example below. In Android 2.1, directly calling the script does not execute it, I am not sure if this is still the case in the newer android build.

service myownservice /bin/sh /etc/myscript.sh
user system
group system

I have once been involved in android development in the past, mostly in the android linux kernel and android source code. Even though I am not working on android anymore, I hope I can still help people here.