If you look in the /etc/init.d directory, there will probably be a README file. There may also be a file named "skeleton". Take a look at those. There may also be some man-pages you can read through.
You may have the "chkconfig" program on your system. It can be used to install a service and determine the runlevels. This program examines and modifies a header in the program to determine which runlevels the program should run as.
For example, on my laptop, here is part of the beginning of /etc/init.d/pcmcia:
Code:
#! /bin/bash
# Copyright (c) 1996-2004 SuSE Linux AG, Germany. All rights reserved.
#
# Author: Hubert Mantel <mantel@suse.de>, 1996
# Christian Zoz <zoz@suse.de>, 2000
# Joachim Gleissner <jg@suse.de>, 2004
#
# /etc/init.d/pcmcia
#
### BEGIN INIT INFO
# Provides: pcmcia
# Required-Start: $local_fs
# X-UnitedLinux-Should-Start: coldplug
# Required-Stop:
# X-UnitedLinux-Should-Stop:
# Default-Start: 2 3 5
# Default-Stop:
# Description: Loads pcmcia base modules and starts cardmgr
### END INIT INFO
Not all systems use this style of starting services. Even if your distro does, you will want to read the documentation that comes with your system.
For example, there may be man-pages for "init", "chkconfig", and even for items such as "inittab" and "init.d". Consider printing out the man-pages.
I use the command "man -t <topic> | kghostview -" to read manpages. This produces a postscript version (much better looking). You could print it out the man-page from the ghostscript viewer program, or by issuing the command,
"man -t <topic> | lpr" which pipes the output to the printer.
Good Luck.