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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-09-2004, 04:20 AM
|
#1
|
LQ Newbie
Registered: Oct 2004
Posts: 15
Rep:
|
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?
|
|
|
12-09-2004, 04:29 AM
|
#2
|
Member
Registered: Aug 2003
Location: Edinburgh
Distribution: Server: Gentoo2004; Desktop: Ubuntu
Posts: 720
Rep:
|
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
|
|
|
12-09-2004, 04:31 AM
|
#3
|
LQ Newbie
Registered: Oct 2004
Posts: 15
Original Poster
Rep:
|
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
|
|
|
12-09-2004, 04:32 AM
|
#4
|
Member
Registered: Aug 2003
Location: Edinburgh
Distribution: Server: Gentoo2004; Desktop: Ubuntu
Posts: 720
Rep:
|
does mandrake not also use chkconfig?
hamish
|
|
|
12-09-2004, 04:39 AM
|
#5
|
LQ Newbie
Registered: Oct 2004
Posts: 15
Original Poster
Rep:
|
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.
|
|
|
12-09-2004, 04:41 AM
|
#6
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
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
|
|
|
12-09-2004, 04:47 AM
|
#7
|
LQ Newbie
Registered: Oct 2004
Posts: 15
Original Poster
Rep:
|
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?
|
|
|
12-09-2004, 04:51 AM
|
#8
|
Member
Registered: Aug 2003
Location: Edinburgh
Distribution: Server: Gentoo2004; Desktop: Ubuntu
Posts: 720
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 11:23 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|