LinuxQuestions.org
Help answer threads with 0 replies.
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 06-10-2005, 07:49 PM   #1
linux-rulz
Member
 
Registered: Dec 2004
Distribution: Windows XP Home, Ubuntu Hoary
Posts: 584

Rep: Reputation: 30
Shell script at system boot


Hey, just wondering, is there anyway to make a shell script run automatically when I first boot my system?
 
Old 06-10-2005, 07:54 PM   #2
omes
Member
 
Registered: Jan 2003
Distribution: debian, FreeBSD
Posts: 120

Rep: Reputation: 15
What distro are you using?

- omes
 
Old 06-10-2005, 07:57 PM   #3
mhallbiai
Member
 
Registered: Jun 2005
Posts: 96

Rep: Reputation: 16
adding it to /etc/rc.local would be the easiest and cause it to run on each boot for any runlevel

if you wanted it to run only in particular runlevels then you may want to considfer adding it to /etc/init.d/ and adding the appropriate start/kill entries to your /etc/rc#.d/ directories

hope this helps
 
Old 06-10-2005, 08:01 PM   #4
omes
Member
 
Registered: Jan 2003
Distribution: debian, FreeBSD
Posts: 120

Rep: Reputation: 15
Quote:
Originally posted by mhallbiai
adding it to /etc/rc.local would be the easiest and cause it to run on each boot for any runlevel
This depends on the distro he's using. The best way to start a script at boot would be the way that is default with the distro..

- omes
 
Old 06-10-2005, 08:26 PM   #5
linux-rulz
Member
 
Registered: Dec 2004
Distribution: Windows XP Home, Ubuntu Hoary
Posts: 584

Original Poster
Rep: Reputation: 30
Hi. Sorry, I should have given more information. I am running CentOS 4, which, for those who don't know, is RHEL4 minus Red Had Trademarks.

What I am trying to do is get the bttv driver (which did not come with Red Hat's kernel, I compiled it against their kernel myself) to load at boot. This is on two computers I am trying to do this. On one computer, I have to issue the command:

modprobe bttv

and on the other:

modprobe bttv tuner=2

This is my /etc/modprobe.conf file (on the computer without the tuner=2 option):

alias eth0 8139too
alias snd-card-0 snd-ens1370
options snd-card-0 index=0
install snd-ens1370 /sbin/modprobe --ignore-install snd-ens1370 && /usr/sbin/alsactl restore >/dev/null 2>&1 || :
remove snd-ens1370 { /usr/sbin/alsactl store >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-ens1370
alias char-major-81 snd-bt87x
alias usb-controller ehci-hcd
alias usb-controller1 uhci-hcd

I tried adding numerous entries to it to get the bttv driver to load (using the tuner=2 option on the other system is very important) but it would not work, so I was thinking of making a shell script to automatically run modprobe bttv at system boot. If you know what I should add to /etc/modprobe.conf to get this to work, that would be even more helpful.
 
Old 06-10-2005, 08:29 PM   #6
mhallbiai
Member
 
Registered: Jun 2005
Posts: 96

Rep: Reputation: 16
omes, i agree.

since linux-rulz did not specify and only has centOS listed for his distribution(s) that is the solution i provided. from what i have heard centOS is really nothing more than RHEL with RedHat (name, logos, etc) removed which uses rc.local. i could be mistaken, i have never used centOS.
 
  


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
How to run a shell script on boot up? AussieGit Linux - Newbie 4 11-02-2005 06:10 PM
Run shell script in RedHat after boot dmorse Linux - General 1 08-23-2005 01:54 PM
can we telnet the system using shell script suchi_s Programming 18 02-18-2005 02:43 PM
Auto-Executing Shell Script on boot benrose111488 Linux - Software 5 12-18-2004 12:52 AM
Help with Howto start a shell script at boot draven Linux - Newbie 7 03-03-2004 11:20 PM

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

All times are GMT -5. The time now is 02:50 AM.

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