Click to See Complete Forum and Search --> : Cannot start tomcat
sparkles43
03-14-2006, 08:14 PM
I have installed JAVA correctly but I cannot get tomcat to start. When I do a
[root@muthasucka init.d]# service tomcat start
i get
env: /etc/init.d/tomcat: No such file or directory
I have done a
[root@muthasucka init.d]# chkconfig --add tomcat
and I have the tomcat file in the /etc/init.d directory with the correct permissions. Can anyone help me? I am suspecting the "env" in the error message is refering to an environmental variable, but I am not sure. Any suggestion would be appreciated
bwkaz
03-14-2006, 08:37 PM
"env" is a program, actually -- it runs a subprocess in a modified environment. The most common use of it is "env -i", which clears out the environment (then sets various other environment variables as given on the env command line).
The problem is coming in when env tries to start your tomcat script. Stuff that I can think of to check:
(1) Does the tomcat script start with #!/bin/sh or #!/bin/bash? Or something else?
(2) What are the line-endings set to? If you wrote the script on any OS other than Linux, you can have problems with it, even if your editor shows the script correctly. If you wrote it from scratch on Linux, though, then that shouldn't be a problem.
voidinit
03-14-2006, 10:31 PM
Another thing to check is that /etc/init.d/tomcat isn't a symlink to nowhere.
sparkles43
03-15-2006, 12:20 PM
The script starts with #!/bin/sh. I do have a symlink
[root@muthasucka opt]# ls -la
total 24
drwxr-xr-x 4 root root 4096 Mar 14 13:46 .
drwxr-xr-x 23 root root 4096 Mar 13 23:42 ..
drwxr-xr-x 12 1000 1000 4096 Mar 14 14:25 httpd-2.2.0
drwxrwxr-x 11 tomcat tomcat 4096 Mar 13 16:23 jakarta-tomcat-5.5.9
lrwxrwxrwx 1 root root 26 Mar 13 16:27 tomcat -> /opt/jakarta-tomcat-5.
sparkles43
03-15-2006, 12:24 PM
I am getting no such file or directory..yet, here is the file right here. Do I need to do something else to make it be seen as a service?
-rwxr-xr-x 1 root root 3060 Mar 8 09:13 sshd
-rwxr-xr-x 1 root root 1369 Feb 21 2005 syslog
-rwxr-xr-x 1 root root 1816 Mar 14 18:16 tomcat
-rwxr-xr-x 1 root root 1896 Feb 21 2005 vncserver
-rwxr-xr-x 1 root root 1548 Aug 21 2005 winbind
-rwxr-xr-x 1 root root 3710 Oct 7 07:02 xfs
-rwxr-xr-x 1 root root 2497 Aug 21 2005 xinetd
-rwxr-xr-x 1 root root 2497 Feb 21 2005 ypbind
-rwxr-xr-x 1 root root 1036 Feb 18 09:38 yum
[root@muthasucka init.d]# pwd
/etc/init.d
[root@muthasucka init.d]# service tomcat start
env: /etc/init.d/tomcat5: No such file or directory
sparkles43
03-15-2006, 12:37 PM
Actually the error is
[root@muthasucka init.d]# service tomcat start
env: /etc/init.d/tomcat: No such file or directory
so the tomcat file is in that directory
bwkaz
03-15-2006, 07:49 PM
Here's an idea: Why not get rid of the "service" command and odd things that it may be doing?
/etc/init.d/tomcat start
sparkles43
03-16-2006, 01:28 PM
Thanks bwkaz. That seemed to work. Now I just need to figure out what is wrong in my script. But this is a workaround for now and at least I can get the service started.