LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-09-2004, 05:20 AM   #1
darrenjhopkins
LQ Newbie
 
Registered: Oct 2004
Posts: 15

Rep: Reputation: 0
Running scripts on startup


Hello again all,

I would like to have certain programs to start running when I boot up (e.g. would like to start apache and then another service)
Where would be the best place to put this in?
I have tried this in the .profile and .bashrc for each user, but I'm guessing there must be a better generic place to do this. Would this have something to do with init.d?
 
Old 12-09-2004, 05:29 AM   #2
hamish
Member
 
Registered: Aug 2003
Location: Edinburgh
Distribution: Server: Gentoo2004; Desktop: Ubuntu
Posts: 720

Rep: Reputation: 30
what are you running?

if redhat or similar, I think you use /sbin/chkconfig --list to show which programmes start at startup. You can then do /sbin/chkconfig --help to get the syntax for setting these to start.

In gentoo, do rc-update add apache2 default.

Hamish
 
Old 12-09-2004, 05:31 AM   #3
darrenjhopkins
LQ Newbie
 
Registered: Oct 2004
Posts: 15

Original Poster
Rep: Reputation: 0
Apoligies, I'm running Mandrake 10.
I've seen from ps -wwaux that init is the first command that gets run, so I'm guessing that this could perhaps spawn off a set of sub-scripts.

All I want to do is make sure that when I start up, that apache and another service is started.

Cheers for the help
 
Old 12-09-2004, 05:32 AM   #4
hamish
Member
 
Registered: Aug 2003
Location: Edinburgh
Distribution: Server: Gentoo2004; Desktop: Ubuntu
Posts: 720

Rep: Reputation: 30
does mandrake not also use chkconfig?

hamish
 
Old 12-09-2004, 05:39 AM   #5
darrenjhopkins
LQ Newbie
 
Registered: Oct 2004
Posts: 15

Original Poster
Rep: Reputation: 0
hmmm - chkconfig lists a whole lot of programs, but this doesn't really halp me set something to run. Not sure how to actually add stuff to this either.
 
Old 12-09-2004, 05:41 AM   #6
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
In Mandrake you have the Mandrake Control Center. Off the top of my head I cannot remember the exact location, but if you tool around in there you will come across a page that lets you 'tick and untick' boxes to have them start at bootup or not. Check for a "services" tab maybe.

Cool
 
Old 12-09-2004, 05:47 AM   #7
darrenjhopkins
LQ Newbie
 
Registered: Oct 2004
Posts: 15

Original Poster
Rep: Reputation: 0
AHA! Found it - this lists all the services.
Now, how do I add stuff to this (i.e. /usr/local/apache2/bin/apachectl start)

I've still been reading about the init.d and adding stuff to rc<number>.d profiles?
 
Old 12-09-2004, 05:51 AM   #8
hamish
Member
 
Registered: Aug 2003
Location: Edinburgh
Distribution: Server: Gentoo2004; Desktop: Ubuntu
Posts: 720

Rep: Reputation: 30
if chkconfig worked, then you can see which services are starting at each runlevel (1,2,3,4,5,6)

you can add a service to start at level 3 by doing:

/sbin/chkconfig add 3 apache

I dont have mandrake on this machine, so I can't tell you exectly. But that is the basic ided. /sbin/chkconfig --help will give you the exect syntax.

Hamish
 
  


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
startup scripts... ValidiusMaximus Linux - Software 8 01-11-2005 06:55 PM
Startup Scripts jhartney Linux - Newbie 3 01-07-2005 02:35 AM
running scripts on startup kaguru Linux - Newbie 2 01-10-2004 07:59 AM
Running Scripts/Commands on Startup drknow Linux - Newbie 4 01-09-2004 06:14 AM
startup scripts amphion Linux - Newbie 8 03-28-2003 02:39 PM


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