LinuxQuestions.org
Review your favorite Linux distribution.
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 09-10-2003, 10:08 AM   #1
kyiyer
LQ Newbie
 
Registered: Sep 2003
Posts: 1

Rep: Reputation: 0
How do I Start daemons At Boot?


Hi

Just installed my first RH Linux 9.0 system. Managed to install Apache 2.x, PHP 4.x.

httpd does not load at boot time automatically. I have to manually issue the command /wwwroot/bin/apachectl start.

How do I automate this so that httpd will start whenever the system is rebooted? Of course, I never want to re-boot it.

If I want a particular application to run after Linux has finished booting up, but before a user has logged in, where do I put the command?

If I want custom login scripts for users, which is the file I need to modify. Basically, I want to run a script every time a user logs in for the first time everyday.

Thanks very much

Iyer
 
Old 09-10-2003, 10:28 AM   #2
daveo
Member
 
Registered: Sep 2003
Location: Holland
Distribution: Gentoo 1.4, Slackware
Posts: 196

Rep: Reputation: 30
Re: How do I Start daemons At Boot?

Quote:
Originally posted by kyiyer
Hi

httpd does not load at boot time automatically. I have to manually issue the command /wwwroot/bin/apachectl start.

How do I automate this so that httpd will start whenever the system is rebooted? Of course, I never want to re-boot it.

If I want a particular application to run after Linux has finished booting up, but before a user has logged in, where do I put the command?

If I want custom login scripts for users, which is the file I need to modify. Basically, I want to run a script every time a user logs in for the first time everyday.

1. To configure the httpd service to start up at boot time you can use an initscript utility, such as /sbin/chkconfig, /sbin/ntsysv, or the Services Configuration Tool program.

2. Loading afther linux is loaded, so I assume that it must be the last app to load huh? check /etc/init.d/rc.local

3. Edit something like /etc/profile if it needs to be executed when a user logs-in

4. custom login scripts can be managed from the above mentioned file, by checking on the user ID or group.

Remember to allways make a backup, of stuff you'll going to change.

Hope this helps
 
Old 09-10-2003, 12:23 PM   #3
Skyline
Senior Member
 
Registered: Jun 2003
Distribution: Debian/other
Posts: 2,104

Rep: Reputation: 45
Create a symlink from the relevant service in /etc/rc.d/init.d and put it in /etc/rc.d/rcX.d were X is the run level directory corresponding to the run level you want the service to run at - then rename it to incorporate Sxx ie capital S and a two digit ordering number to signify when the service should start in that run level - be careful how you order it, some services are dependant on others already running etc to start properly.
 
Old 09-10-2003, 01:47 PM   #4
daveo
Member
 
Registered: Sep 2003
Location: Holland
Distribution: Gentoo 1.4, Slackware
Posts: 196

Rep: Reputation: 30
Quote:
Originally posted by Skyline
Create a symlink from the relevant service in /etc/rc.d/init.d and put it in /etc/rc.d/rcX.d were X is the run level directory corresponding to the run level you want the service to run at - then rename it to incorporate Sxx ie capital S and a two digit ordering number to signify when the service should start in that run level - be careful how you order it, some services are dependant on others already running etc to start properly.
Sounds easy for the newbie area
 
Old 09-10-2003, 01:48 PM   #5
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
Quote:
Just installed my first RH Linux 9.0 system. Managed to install Apache 2.x, PHP 4.x.
Did you install the RPM or a tarball ?

If it is the RPMs, you can use RedHat's Service Configuration GUI tool.
In the menu, go to System Settings -> Server Settings -> Services
OR
At the command line, type: redhat-config-services

You can also use the chkconfig command. For example:
Code:
chkconfig --level 345 httpd on
 
Old 09-10-2003, 01:54 PM   #6
daveo
Member
 
Registered: Sep 2003
Location: Holland
Distribution: Gentoo 1.4, Slackware
Posts: 196

Rep: Reputation: 30
Quote:
Originally posted by Mathieu
Did you install the RPM or a tarball ?

If it is the RPMs, you can use RedHat's Service Configuration GUI tool.
In the menu, go to System Settings -> Server Settings -> Services
OR
At the command line, type: redhat-config-services

You can also use the chkconfig command. For example:
Code:
chkconfig --level 345 httpd on
As mentioned in my post before ....
 
Old 09-10-2003, 05:11 PM   #7
Genesee
Member
 
Registered: Dec 2002
Distribution: Slackware
Posts: 927

Rep: Reputation: 30
the Red Hat docs are a very good reference:

http://www.redhat.com/docs/manuals/l...-shutdown.html

 
Old 09-12-2003, 06:31 PM   #8
troworld
Member
 
Registered: Jul 2003
Location: Toronto, ON
Distribution: Mandrake 9.1
Posts: 41

Rep: Reputation: 15
Quote:
Originally posted by Skyline
Create a symlink from the relevant service in /etc/rc.d/init.d and put it in /etc/rc.d/rcX.d were X is the run level directory corresponding to the run level you want the service to run at - then rename it to incorporate Sxx ie capital S and a two digit ordering number to signify when the service should start in that run level - be careful how you order it, some services are dependant on others already running etc to start properly.
the apachectl script is not listed in chkconfig --list. If I was to create an apachectl file in /etc/rc.d/init.d, what would I put in the script?? I'm not familiar with shell scripting.

I'm accessing the machine using SSH, so I can't really use any sort of a graphic config utility.

Thanks for any help
 
Old 09-18-2003, 03:22 PM   #9
troworld
Member
 
Registered: Jul 2003
Location: Toronto, ON
Distribution: Mandrake 9.1
Posts: 41

Rep: Reputation: 15
no one has an idea?
 
Old 09-18-2003, 08:05 PM   #10
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
Quote:
the apachectl script is not listed in chkconfig --list. If I was to create an apachectl file in /etc/rc.d/init.d, what would I put in the script??
When you installed Apache, was it a RPM or a tarball (.tar.gz) ?

If it is a RPM, then it is called httpd.
Code:
chkconfig --list httpd
If it is a tarball, you will need to edit /etc/rc.d/rc.local by appending /usr/sbin/apachectl to the file.
 
Old 09-18-2003, 09:32 PM   #11
troworld
Member
 
Registered: Jul 2003
Location: Toronto, ON
Distribution: Mandrake 9.1
Posts: 41

Rep: Reputation: 15
I believe it was an rpm from the original Mandrake CD.

Thanks for the tip! I'll try it and tell you whether it worked or not.
 
  


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
how to start daemons in slackware anindyanuri Slackware 5 07-12-2005 10:13 PM
start stop daemons aizkorri Linux - Newbie 4 05-06-2004 07:26 AM
Start Services/Daemons exkor5000 Linux - Newbie 1 11-16-2003 06:00 PM
What daemons i stop to boot faster? h1tman Linux - Newbie 9 07-24-2003 12:11 AM
Starting Daemons at boot nero64 Linux - Newbie 1 01-03-2003 03:14 AM


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