Hi
If I want to execute some script/command at every startup (When ever linux starts), How should i configure linux.
Priyadarshi _____________________________________________________________ Tired of limited space on Yahoo and Hotmail? Free 100 Meg email account available at http://www.dacafe.com
Sometime Today, acharya@dacafe.com assembled some asciibets to say:
If I want to execute some script/command at every startup (When ever linux starts), How should i configure linux.
Put it at the end of /etc/rc.d/rc.local. Provided of course that you are using System V init scripts.
Philip
acharya@dacafe.com wrote:
If I want to execute some script/command at every startup (When ever linux starts), How should i configure linux.
Priyadarshi
Hi Priyadarshi,
When the system starts up, a series of scripts are run to start the various services. Almost all of these are run from the sub-directories of /etc/rc.d. It is the /etc/rc.d/rc script which starts most of these services when the system is booted and stops them when the system is shut down.
The /etc/rc.d directory contains rcX.d subdirectories (where X can be substituted by numbers 0-6 representing each runlevel). The programs within these directories are symbolic links, usually to a file in /etc/rc.d/inet.d. This provides an easy and consistent mechanism for configuring which programs are started at boot time.
Now consider that you have to add a script called kapilmenu to startup. To do this put the shell script kapilmenu in /etc/rc.d/init.d.
For the manual method just create the following symbolic links for each runlevel:
cd /etc/rc.d/rcX.d ; ln -s ../init.d/kapilmenu K28kapilmenu --- this to this to terminate the service in some particular runlevel "X".
cd /etc/rc.d/rcX.d ; ln -s ../init.d/kapilmenu S82kapilmenu --- this to this to startup the service in some particular runlevel "X".
You could also use chkconfig. See: $man chkconfig
_________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com