[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: startup scripts



-- Sharninder Singh-662 <Sharninder.Singh-662@ushacomm.co.in> wrote
(on Tuesday, 27 May 2003, 05:21 PM +0530):
> i have a script which i want to run just aftert the system has booted up and
> before the login prompt is shown to the user...where do put this script ? i
> am running debian woody.

Debian uses SysV style boot scripts. You need to add your script to
/etc/init.d/ , and then you need to put a link in the appropriate
runlevel (/etc/rcX.d, where X is the default runlevel as defined in
/etc/inittab). The link name would be something like
/etc/rcX.d/S9xscriptname. 

For instance, I have a script called watchd that watches a directory for
changes and then performs certain actions. I placed the script at
/etc/init.d/watchd. My default runlevel is 3, according to my inittab.
The last script to run in there is S99gdm. Thus, I created a link using
'ln -s /etc/init.d/watchd /etc/rc3.d/S90watchd'.

Another way to achieve the linking is to use the program 'update-rc.d'.
You would do this by, again, placing the script in /etc/init.d, then
running the following:

    update-rc.d scriptname defaults NN

where 'NN' is the order in which you wish it to be executed (in the case
of my script, watchd, it would be '90').

HTH.

-- 
Matthew Weier O'Phinney
matthew@weierophinney.net
http://matthew.weierophinney.net



Reply to: