On system bootup, the init process runs the script /etc/rc.d/rc.sysinit to get the system up. The script will do the usual business of checking and remounting the root filesystem and will start up basic networking.
After that is done, rc.sysinit will run all executables from the directory /etc/rc.d/rc.start. It does not matter whether these are scripts or compiled programs. All executables will be passed the parameter start. For example, if there is a script called runme, rc.sysinit will execute runme start.
The default initscripts that come with ttylinux are stored in the directory /etc/rc.d/init.d. Those that need to be run at bootup are symlinked into the rc.start directory. If you want to write your own initscripts, place them in the init.d directory and place a symlink in the rc.start and perhaps also in the rc.stop directory.
If you don't want to write your own script, you can also add commands to the file /etc/rc.d/rc.local - this script will be run at the very end of the boot process, after all others scripts have run.
On shutdown, the script /etc/rc.d/rc.reboot gets run. This will run all the programs from the /etc/rc.d/rc.stop directory, and each program will be passed a stop parameter. Our example script called runme would be executed as runme stop.
Both scripts from rc.start and rc.stop will be run in ASCII order. If you need them to run in a specific order, you could for example use names like 01.first and 02.second. This is how the scripts that come with ttylinux are named. Everything in rc.start and rc.stop should be a symlink, so you can simply remove that link if you want to disable a specific script.
Initscripts can also be called manually in case you want to start or stop something while the system is running. To make this easier, a helper script called service is provided. For example:
service inetd stop
will stop the inetd server daemon. All scripts (except pppconf, which understands few options) know about the options start, stop, and restart that do the obvious things. Some scripts also know about status and reload for displaying status information and for reloading service configuration files.
All scripts will print a list of supported options if they are called with no option present.