All you need to do is add two lines of comments to your /etc/init.d/SCRIPTNAME script that tell chkconfig at which runlevels it should run.
from this manpage:
For example, random.init has these three lines:
# chkconfig: 2345 20 80
# description: Saves and restores system entropy pool for \
# higher quality random number generation.
This says that the random script should be started in levels 2
+, 3, 4,
and 5, that its start priority should be 20, and that its stop
+ prior-
ity should be 80. You should be able to figure out what the d
+escrip-
tion says; the \ causes the line to be continued. The extra sp
+ace in
front of the line is ignored.
The runlevel determines at which runlevels the deamon should run. The system is always in one runlevel only. Usual runlevels are 3 for multi-user non-graphical (default mode for server machines), 5 for multi-user graphical mode (default mode for desktop machines) and 1 for single-user non-gui mode (for low-level system management and repair). what each runlevel is for can be changed, these are just usual configurations
To see which run-level is the default for your system, take a look at /etc/inittab. There should be a line about that at the top somewhere. Mine looks like:
# The default runlevel.
id:3:initdefault:
So my machine's default runlevel is 3 (though I also use 5)
The start and end priorities determine the order in which deamons are started and stopped: higher start priority means it's started later than lower priority.
After you've done that, run "chkconfig --add NAME_OF_SCRIPT_IN_INITRD" to add it to the list of deamons to start automatically.
|