Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 10-17-2003, 10:18 AM   #1
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, 10:33 AM   #2
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, 10:41 AM   #3
Registered: Aug 2003
Location: New Delhi, India
Distribution: RHEL AS 3/4, Windows XP
Posts: 546

Rep: Reputation: 31 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.


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 ( that loads the modules for sound and tv.

# 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

[You can call your custom made scripts here]

Hope that helps


Old 10-17-2003, 11:29 AM   #4
LQ Newbie
Registered: Sep 2003
Posts: 19

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


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

All times are GMT -5. The time now is 08:48 AM.

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