Operating System - Linux
1830862 Members
2604 Online
110017 Solutions
New Discussion

can't startup the service when server start

 
SOLVED
Go to solution
peterchu
Super Advisor

can't startup the service when server start

I tried to link the service to the start-up ,

#ln -s /usr/local/apache/bin/httpd /etc/init.d
# pwd
/etc/init.d
#ll /usr/local/apache/bin/httpd
lrwxrwxrwx 1 root root 27 Oct 16 15:50 httpd -> /usr/local/apache/bin/httpd

but still can't run this daemon when startup , but i can run it manually , could suggest what is wrong ? thx.
5 REPLIES 5
ramkumar
Valued Contributor
Solution

Re: can't startup the service when server start



I think you are expert in SVR4 Systems thats why you are doing like this .

better try to configure in the following steps

#chkconfig --list httpd
see whether it is on or off in runlevel 4 ,5,6
if not
#chkconfig --level 3 on 4 on 5 on httpd
it will start the service at desired run levels


Vitaly Karasik_1
Honored Contributor

Re: can't startup the service when server start

in order to run this script on boot, you should add link

ln -s /etc/init.d/httpd /etc/rc3.d/S99httpd

and

ln -s /etc/init.d/httpd /etc/rc5.d/S99httpd

[not every package knows to work with chkconfig]

Steven E. Protter
Exalted Contributor

Re: can't startup the service when server start

either method will work in the prior two posts.

Linux books recomend

chkconfig -level 12345 httpd on


Script must exist in /etc/init.d

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Vitaly Karasik_1
Honored Contributor

Re: can't startup the service when server start

as far as I remember, chkconfig doesn't work with every script, or at leats you should "chkconfig add httpd" in order to add script to chkconfig managament.
Stuart Browne
Honored Contributor

Re: can't startup the service when server start

Word of note:

YOU DEFINATELY DO NOT WANT TO DIRECTLY LINK A BINARY HERE!

What you want to be linking to is the script '/usr/local/apache/bin/apachectl'. This is the distributed startup/shutdown routine.

As for the 'chkconfig' stuff, it will only work if there is a comment line similar to '# chkconfig 2345 84 16' and a '# description ' line with in it.
One long-haired git at your service...