LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 04-16-2005, 05:45 PM   #1
SkyeFyre
LQ Newbie
 
Registered: Sep 2003
Distribution: Fedora Core 3
Posts: 12

Rep: Reputation: 0
Commands On Startup


Is there a way I can set some commands/programs to start at startup? For example: When the computer starts up, automatically begin running my http server.

Another question actually, every time I start up my computer in linux I have to type in chmod 666 /dev/hdd (That's my DVD drive... go figure) before I can play music CDs on it. How can I set it so that it doesn't keep going back to default every time I start up. I have a similar problem with alsamixer. Every time I reboot the settings all go back to 0 and I have to reset everything.

I'm using Fedora Core 3, and using GRUB if that affects anything.
 
Old 04-16-2005, 05:55 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
your http server = apache? well yes of course. you should already have it.. /etc/init.d/httpd if so just use "chkconfig --level 35 httpd on" to make it run for both X and non-X boots.

for the cdrom... you'd need to look at your udev permissions... /etc/udev/permissions.d/
 
Old 04-16-2005, 06:01 PM   #3
SkyeFyre
LQ Newbie
 
Registered: Sep 2003
Distribution: Fedora Core 3
Posts: 12

Original Poster
Rep: Reputation: 0
Yeah, sorry it's apache. I was just using that as an example. There are a few other programs that I'd just like to start up each time. Is there a way to do it with them?
 
Old 04-16-2005, 08:31 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,164

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
Yes, learn how SysV style init scripts work. Basically you put an init script that can handle start/stop/restart as an argument in /etc/rc.d/init.d. Then you create the approprate SNN<name> or KNN<name> (NN being the priority number) in the correct runlevel(s) (/etc/rc0.d through /etc/rc6.d for runlevels 0-6) to start and stop the script automatically. This is a bit hard to visualize/wrap your head around if you're not used to it, so check out those directories and see how the current scripts are set up. If you installed Apache via RPM the init script should've been created for you and you can just use chkconfig to activate it. Chkconfig is just a front-end for this which creates/removes the symlinks as requested.

[edited to add]: you can also just add startup commands to the /etc/rc.local file if you don't feel like mucking with the full init script setup.

Last edited by btmiller; 04-16-2005 at 08:32 PM.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Commands at startup Maverick1182 Linux - Newbie 5 08-08-2005 06:55 PM
where to put startup commands nickcol Linux - General 1 05-10-2005 06:00 AM
Automated startup commands? ThePenguin Linux - Software 6 09-05-2004 11:56 AM
aterm startup commands DrGnome Linux - Software 1 04-10-2004 02:38 PM
running commands at startup tfalk3 Linux - General 4 05-27-2003 04:57 PM


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