Computing.Net > Forums > Linux > How to autostart tomcat init.d/rc.d

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How to autostart tomcat init.d/rc.d

Reply to Message Icon

Name: rayray705
Date: February 6, 2007 at 19:55:32 Pacific
OS: Ubuntu Linux
CPU/Ram: 2.8ghz/512mb
Comment:

Hi,
I am trying to modify tomcat installation on ubuntu6.10. I installed tomcat correctly and I can start it manually from the command prompt. However I need it to start when the computer boots up. The instructions in my book say to add a script(provided by the author) to the /etc/init.d directory and install the scripts into the rc.d directory using chkconfig.

Apparently chkcofig isn't included in ubuntu, so I installed chkconfig, placed the scripts file in the init.d directory and ran chkconfig. And nothing happened. chkconfig did not complain, but rebooting the computer doesn't start tomcat automatically. None of the error messages that should echo out when tomcat does not boot do not show up during system boot either. So am assuming that the scripts file did not install correctly. What am I doing wrong? Kindly help I am new to the linux environment. I don't what chkconfig does or what init.d and rc.d folders are good for.



Sponsored Link
Ads by Google

Response Number 1
Name: 3Dave
Date: February 8, 2007 at 03:14:44 Pacific
Reply:

Add the command to your rc.local if you are running one. What command are you using to start it? Does the /etc/init.d script work OK? Do you have BUM installed (Boot Up Manager)? Alternatively create symbolic links pointing to the init.d script in the rc.d directories for the runlevels that you want the service to start (probably runlevels 3 and 5 = /etc/rc3.d and /etc/rc5.d). I think in ubuntu you also have rcS.d which is run at boot as opposed to switching runlevels.

Besides all that, are you sure you are using chkconfig correctly? Eg:
# chkconfig --list tomcat
to list an available service
# chkconfig --level 35 tomcat on
to add the service to runlevels 3 and 5

How about installing sysv-rc-conf instead (which is very much like chkconfig)? Or using the ubuntu update-rc.d?


0

Response Number 2
Name: rayray705
Date: February 8, 2007 at 21:02:20 Pacific
Reply:

Thank you for you response. I will try to respond to your questions one by one.
I will gladly add the command to rc.d. Just tell where it is and what it does.
The following is the command I use to start tomcat. It is important to mention that I created a special 'tomcat' user as the book instructed. Only the tomcat user is allowed to work with tomcat.
su -l tomcat -s /bin/bash -c "/usr/local/jakarta-tomcat-5.0.28/bin/startup.sh run"

When I log in as root and execute the above line, tomcat starts with out any problem. But the same line is in the script and doesn't do anything.
One important note: the following is the permissions for the the script file tomcatd.
-rw-r--r-- 1 me me 2171 2007-01-23 23:27 tomcatd. me is me, not the 'tomcat' user or root. It seems that the file is not executable. If I make it executable should I make it executable for me, root, or tomcat?

Yes I do have a boot manager.

After placing the script file in init.d directory I typed chkconfig -add tomcatd to install it.

I don't know what runlevels are.

chkconfig --list tomcat doesn't find anything. However chkconfig --list displays the following.
laptop-mode 0:off 1:off 2:off 3:off 4:off 5:off 6:off
tomcatd 0:off 1:off 2:off 3:off 4:off 5:off 6:off

Can you make sense out of this? Again, I am new to linux and I greatly appreciate your help.


0

Response Number 3
Name: 3Dave
Date: February 9, 2007 at 09:16:15 Pacific
Reply:

Try the following command:
# chkconfig --level 345 tomcatd on
(Note the "d" in tomcatd as the command I gave you previously said only tomcat)

And then:
# chkconfig --list tomcatd
...and it should so that the service if turned on for runlevels 3, 4 and 5.

FYI here's a link explaining runlevels:
http://www.help2go.com/Tutorials/Li...


0

Response Number 4
Name: rayray705
Date: February 9, 2007 at 20:29:35 Pacific
Reply:

Thanks for all your help. I was able to fix the problem by changing the permissions of the file. Now the file is executable by root so it works just fine.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: How to autostart tomcat init.d/rc.d

--->how to clse unwanted servies www.computing.net/answers/linux/how-to-clse-unwanted-servies/24953.html

FAST-HOW-TO XDMCP in Linux www.computing.net/answers/linux/fasthowto-xdmcp-in-linux/21099.html

How to get rear speakers working ? www.computing.net/answers/linux/how-to-get-rear-speakers-working-/17869.html