LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-17-2003, 11:18 AM   #1
windyang12
LQ Newbie
 
Registered: Sep 2003
Posts: 19

Rep: Reputation: 0
automate running scripts


I have some shell scripts, and I want to run these scripts when I boot my machine. How to make this work automatically as root?

Thanks in advance!
 
Old 10-17-2003, 11:33 AM   #2
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
to have them run at boot you could ass them to your /etc/rc.d/rc.local. Note that the file can be in different locations for different ditributions. If you can't find it try 'find /etc -name rc.local'
 
Old 10-17-2003, 11:41 AM   #3
coolamit78
Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: RHEL AS 3/4, Windows XP
Posts: 546

Rep: Reputation: 31
Ok....you can do this using any of the following ways:

1. You can place your executable shell scripts under /etc/rc.d/init.d. All the scripts in this directory are run when the system starts up.

OR

2. ( The Better option)

Make your scripts executable and put them under the directory /usr/local/bin

Now in the /etc/rc.local script, call your scripts one by one. For your reference, I am posting my own rc.local script which calls another script (load_sound_tv_radio.sh) that loads the modules for sound and tv.

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

/usr/local/bin/load_sound_tv_radio.sh
[You can call your custom made scripts here]

Hope that helps

Regards,

amit
 
Old 10-17-2003, 12:29 PM   #4
windyang12
LQ Newbie
 
Registered: Sep 2003
Posts: 19

Original Poster
Rep: Reputation: 0
Thanks so much for your replies! I'll try ...
 
  


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
Running scripts bhmsi Linux - Newbie 6 04-23-2005 07:05 PM
Running scripts moeru Linux - Software 10 07-02-2004 10:42 AM
Need help running scripts from scripts sdouble Linux - Newbie 3 05-31-2004 01:56 PM
Running scripts crash_zero Mandriva 5 04-19-2004 03:23 PM
Help Running Scripts josefalero Linux - Newbie 2 11-14-2002 05:36 PM


All times are GMT -5. The time now is 12:33 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration