LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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-25-2004, 05:48 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 31
run script when restart


I want to run some scripts every time when my RH 8 linux restart , I tried to add it to /etc/inittab , but some scripts will run and some will not run when restart , is there other ways to make the script run when restart ? thx
 
Old 08-25-2004, 06:08 AM   #2
m0rt3r
Member
 
Registered: Mar 2004
Distribution: slackware 10
Posts: 75

Rep: Reputation: 15
you can copy the script to the /etc/rc.d/init.d directory of your system. Then create a symlink so that the script will be started when your system starts, you may want to make the symlink to /etc/rc.d/rc3.d.

For example:
Code:
 cp startscript /etc/rc.d/init.d
, then
Code:
 cd /etc/rc.d/rc3.d
, after that do
Code:
ln -s /etc/init.d/startscript   S00startscript
Hope that helps
 
Old 08-25-2004, 06:25 AM   #3
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 31
thx reply ,

I think it work , but I want to ask what is mean "S00startscript' , why not just add use the original name ( eg. startscript ) ? what is mean "S00" ? thx.
 
Old 08-25-2004, 02:58 PM   #4
m0rt3r
Member
 
Registered: Mar 2004
Distribution: slackware 10
Posts: 75

Rep: Reputation: 15
S00startscript

In red-hat, mandrake, and i think also in fedora all the services and startup scripts are started if they have a capital S, if you want to turn them off you can just change the S to s, or using chkconfig, the name i gave you was just an example, but you need to add a capital S at the beginning, just check the rest of the start up scripts, i'm sure all the ones that are started during boot time have a capital S. Then again i might be wrong because is being a while since i had red-hat, or mandrake, or suse.
Hopefully some else might be sure and correct me or agree with me. Take care
 
Old 08-25-2004, 03:13 PM   #5
linuxboy69
Member
 
Registered: Oct 2003
Distribution: Redhat 9
Posts: 138

Rep: Reputation: 15
You could also use the /etc/rc.local file. That file is ran last when starting up or rebooting your computer.
 
  


Reply



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
MySQL restart script? Fuwex Debian 2 08-17-2005 02:23 PM
Forcing xmodmap to be run on each restart lazymanc Debian 1 05-16-2005 01:01 PM
Restart script blablaman Linux - Newbie 1 08-20-2004 06:09 AM
on Network Up Script run? On Battery power run script? v2-ncl Linux - General 0 12-08-2003 09:34 AM
I wants to run the script(xx) while restart the system. help pls... fmohideen76 Linux - General 2 07-11-2002 01:15 PM

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

All times are GMT -5. The time now is 11:11 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