LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-28-2006, 10:31 AM   #1
balavignesh
LQ Newbie
 
Registered: Dec 2005
Posts: 5

Rep: Reputation: 0
How to put scripts in the startup..?


Hi ,

we need to put a script which is to be executed on the startup of the Linux..

How to achieve this..?

Plz help..


regards
bala
 
Old 08-28-2006, 10:43 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
You didn't mention your distro. For many distros and many Unix variants you create a startup script and put it into /etc/init.d. You then create a symbolic link to this script within /etc/rc?.d where the ? is replaced by the run level (0,1,2,3,4,S) you want it started and stopped at.

Such scripts have a specific format with functions at least for start and stop. You shold put the link for the stop at the run level below the start so that in a shutdown it stops.

Looking at existing scripts in /etc/init.d and the /etc/rc?.d links back to them will give you a good idea of how to build them. Note that links with name S##<scriptname> are start scripts and links with K##<scriptname> are stop scripts. ## is a number indicating in which order the script should run. Typically you make the number complimentary to 100 just for ease. (e.g. S25 start would be K75 stop.)

Note that often /etc/init.d itself may be a symbolic link to where your distro really wants to put the files.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mandriva startup scripts (need to add something to startup before X starts) thunderweasel Mandriva 3 01-01-2006 12:55 AM
Where do I put my cgi-bin scripts? BrianK Linux - Software 2 10-12-2005 10:59 PM
Where to put mldonkey scripts? Aioth Slackware 2 06-19-2004 08:29 AM
put my scripts to PATH Boby Linux - Newbie 1 06-14-2004 12:01 PM
Where to put protected scripts in Apache GoTrolling Linux - Software 4 01-16-2004 01:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration