From: Caolan McNamara (Caolan.McNamara at domain ul.ie)
Date: Tue 07 Sep 1999 - 12:29:27 IST
On 07-Sep-99 michael.hetherton at domain ccs.ie wrote:
>I am using Red Hat Linux 5.2 and running the Apache server. I have developed a
>script to load certain applications and mount file systems. I need to know
>which initialisation script after reboot; I can call my script, i.e. the last
>initialisation script that is run. Also what format the initialisation script
The last script run on startup is rc.local, the last script run before
rc.local is in the rc?.d where ? is the runlevel that you stop at. For
instance with a default startup to X, it is rc5.d. And the last script
run in that dir, is the one with the largest number after the S. Note
that all these scripts are links to one set kept in init.d, so as to
eliminate duplication of scripts in each runlevel.
The last script run on shutdown is thus in rc6.d, the shutdown dir. and
it is the one with the largest number again.
Note that the scripts in init.d are intended to be run with either
start, stop, restart or status as command line options. In each rc?.d
dir if the file is linked beginning with an S, then start is passed
as the argument, if the link begins with K stop is passed as an argument
which is why all the files in rc6.d are prepended with a K, and nearly all
the others are S
Though all you probably want to do is add a call to the script you want
to run at the bottom of /etc/rc.d/rc.local. Note that if the script is
going to block, i.e. not become a daemon automatically or finish quickly
then the whole system will stop on startup waiting for it to finish, so
put an & after the command. That used to be a big problem with sendmail
when the network would go down as it wouldnt daemonize until it had
found a network, terrible nuisance.
The top of /etc/inittab tells you which runlevel is intended for what.
>Thanks for the help
>Michael Hetherton - Software Engineer - Icarus e-Com
>2 St. John's Court, Santry, D9 Tel: 01-8428255
>Irish Linux Users' Group: ilug at domain linux.ie
>http://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
>List maintainer: listmaster at domain linux.ie
Real Life: Caolan McNamara * Doing: MSc in HCI
Work: Caolan.McNamara at domain ul.ie * Phone: +353-86-8790257
URL: http://www.csn.ul.ie/~caolan * Sig: an oblique strategy
Take a break
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:04:32 GMT