Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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.

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 5How about installing sysv-rc-conf instead (which is very much like chkconfig)? Or using the ubuntu update-rc.d?

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:offCan you make sense out of this? Again, I am new to linux and I greatly appreciate your help.

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...

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.

![]() |
![]() |
![]() |

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