Bug 471639

Summary: tomcat does not start/work
Product: [openSUSE] openSUSE 11.1 Reporter: Iron Bone <iron.bone>
Component: JavaAssignee: Michal Vyskocil <mvyskocil>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Critical    
Priority: P2 - High CC: awafaa, forgotten_QPz6RCyXU0
Version: Final   
Target Milestone: ---   
Hardware: i686   
OS: openSUSE 11.1   
Whiteboard: .
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Iron Bone 2009-02-02 18:51:54 UTC
User-Agent:       Opera/9.63 (X11; Linux i686; U; pl) Presto/2.1.1

After starting tomcat I obtain the following:
dtomcat6 start
/usr/bin/dtomcat6: line 22: /logs/catalina.out: No such file or directory

When starting by 
rctomcat6 start 
I have the following:

rctomcat6 start
Starting Tomcat (/usr/share/tomcat6)                                    done

rctomcat6 status
Checking for Tomcat (/usr/share/tomcat6)                                dead

It seems that $CATALINA_HOME is not set/used correctly. I the scripts the path to catalina.out is
${CATALINA_HOME}/logs/catalina.out
and the missing file (above) is
/logs/catalina.out

so ${CATALINA_HOME} is empty at that moment.

I use
java -version
java version "1.6.0_11"
Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
Java HotSpot(TM) Server VM (build 11.0-b16, mixed mode)



Reproducible: Always

Steps to Reproduce:
1.start dtomcat6 start as root
2.
3.
Comment 1 Forgotten User QPz6RCyXU0 2009-02-02 23:44:03 UTC
It seems that somehow /usr/bin/dtomcat6 doesn't know what JAVA_HOME is set to. For all tomcat6 installations on opensuse 11.1 we had to add the following:

. /etc/profile.d/alljava.sh

on line #13

Otherwise, /etc/init.d/tomcat6 is unusable.
Comment 2 Andrew Wafaa 2009-02-03 11:32:11 UTC
I added the output from 'echo $JAVA_HOME' to the top of /usr/bin/dtomcat6 to get round it.
Comment 3 Michal Vyskocil 2009-02-09 15:34:21 UTC
It seems that a default JAVA_HOME missed in sysconfig.
Comment 8 Michal Vyskocil 2009-02-10 11:49:03 UTC
Submitted a fixed package. The default value of JAVA_HOME is /etc/alternatives/jre, so tomcat6 will be ready after installation.
Comment 9 Swamp Workflow Management 2009-02-24 17:16:46 UTC
Update released for: tomcat6, tomcat6-admin-webapps, tomcat6-docs-webapp, tomcat6-javadoc, tomcat6-jsp-2_1-api, tomcat6-lib, tomcat6-servlet-2_5-api, tomcat6-webapps
Products:
openSUSE 11.1 (i586)
Comment 10 Iron Bone 2009-02-25 12:18:10 UTC
After installing the updates tomcat does not work. I reinstalled also it and the situation is the same - it does not work.
I get the following:
rctomcat6 start
Starting Tomcat (/usr/share/tomcat6)                                    done

rctomcat6 status
Checking for Tomcat (/usr/share/tomcat6)                                dead

BUT after starting 
dtomcat6 start
/usr/bin/dtomcat6: line 22: /logs/catalina.out: No such file or directory

Maybe the problem is in the directory /logs - there is no such directory in opensuse 11.1
Comment 11 Michal Vyskocil 2009-02-25 13:15:08 UTC
Did you use a default configuration, or change something? Because my installation works perfect. And a /logs/catalina.out is strange, because a default value in initscript is /var/log/tomcat6/catalina.out

What do you have in /etc/sysconfig/tomcat6 and /etc/tomcat6/tomcat6.conf?
Comment 12 Forgotten User QPz6RCyXU0 2009-02-25 13:31:50 UTC
We see the same issue, after upgrading to this latest patch:

wikitest:~ # rctomcat6 start
Starting Tomcat (/usr/share/tomcat6)lock file found but no process running for pid 7878, continuing                                                  done
wikitest:~ # rctomcat6 status
Checking for Tomcat (/usr/share/tomcat6)                             dead
wikitest:~ # rctomcat6 stop
Shutting down Tomcat (/usr/share/tomcat6)                            failed

And here are our config files:

wikitest:~ # egrep -v '^#|^$' /etc/sysconfig/tomcat6
JAVA_HOME=""
JAVA_OPTS="-server -Xms1024m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=256m -Dconfluence.disable.peopledirectory.anonymous=true -Djava.awt.headless=true"
TOMCAT_OPTS=""
CATALINA_OPTS=""

wikitest:~ # egrep -v '^#|^$' /etc/tomcat6/tomcat6.conf
JAVA_HOME="/etc/alternatives/jre"
CATALINA_BASE="/usr/share/tomcat6"
CATALINA_HOME="/usr/share/tomcat6"
JASPER_HOME="/usr/share/tomcat6"
CATALINA_TMPDIR="/var/cache/tomcat6/temp"
TOMCAT_USER="tomcat"
SECURITY_MANAGER="false"
SHUTDOWN_WAIT="30"
SHUTDOWN_VERBOSE="false"
CATALINA_PID="/var/run/tomcat6.pid"

As you can see, they're the default, except adding extra memory options.


wikitest:~ # update-alternatives --display java
java - status is auto.
 link currently points to /usr/lib64/jvm/jre-1.6.0-sun/bin/java
/usr/lib64/jvm/jre-1.6.0-sun/bin/java - priority 1613
 slave ControlPanel: /usr/lib64/jvm/jre-1.6.0-sun/bin/ControlPanel
 slave keytool.1.gz: /usr/share/man/man1/keytool-java-1_6_0-sun.1.gz
 slave rmid.1.gz: /usr/share/man/man1/rmid-java-1_6_0-sun.1.gz
 slave orbd.1.gz: /usr/share/man/man1/orbd-java-1_6_0-sun.1.gz
 slave rmid: /usr/lib64/jvm/jre-1.6.0-sun/bin/rmid
 slave servertool.1.gz: /usr/share/man/man1/servertool-java-1_6_0-sun.1.gz
 slave javaws.1.gz: /usr/share/man/man1/javaws-java-1_6_0-sun.1.gz
 slave jre_exports: /usr/lib64/jvm-exports/jre-1.6.0-sun
 slave policytool: /usr/lib64/jvm/jre-1.6.0-sun/bin/policytool
 slave orbd: /usr/lib64/jvm/jre-1.6.0-sun/bin/orbd
 slave rmiregistry: /usr/lib64/jvm/jre-1.6.0-sun/bin/rmiregistry
 slave tnameserv: /usr/lib64/jvm/jre-1.6.0-sun/bin/tnameserv
 slave rmiregistry.1.gz: /usr/share/man/man1/rmiregistry-java-1_6_0-sun.1.gz
 slave keytool: /usr/lib64/jvm/jre-1.6.0-sun/bin/keytool
 slave tnameserv.1.gz: /usr/share/man/man1/tnameserv-java-1_6_0-sun.1.gz
 slave javaws: /usr/lib64/jvm/jre-1.6.0-sun/bin/javaws
 slave servertool: /usr/lib64/jvm/jre-1.6.0-sun/bin/servertool
 slave java.1.gz: /usr/share/man/man1/java-java-1_6_0-sun.1.gz
 slave policytool.1.gz: /usr/share/man/man1/policytool-java-1_6_0-sun.1.gz
 slave jre: /usr/lib64/jvm/jre-1.6.0-sun
Current `best' version is /usr/lib64/jvm/jre-1.6.0-sun/bin/java.


Again, the problem is fixed by making sure /usr/bin/dtomcat6 knows what JAVA_HOME is, for example:

--- /usr/bin/dtomcat6.orig      2009-02-25 09:26:11.148524078 -0500
+++ /usr/bin/dtomcat6   2009-02-25 09:26:32.827550895 -0500
@@ -6,6 +6,8 @@
 #    TOMCAT_CFG="/etc/tomcat6/tomcat6.conf"
 #fi

+. /etc/profile.d/alljava.sh
+
 if [ -r "$TOMCAT_CFG" ]; then
     . $TOMCAT_CFG
 fi


Is there any particular reason for having two tomcat6 config files, and duplicate options between them?
Comment 13 Forgotten User QPz6RCyXU0 2009-02-25 13:33:13 UTC
Not sure if I users are able to reopen cases, but here it goes...
Comment 14 Iron Bone 2009-02-25 18:20:52 UTC
I use the default conguration.


 egrep -v '^#|^$' /etc/sysconfig/tomcat6
JAVA_HOME=""
JAVA_OPTS=""
TOMCAT_OPTS=""
CATALINA_OPTS=""



egrep -v '^#|^$' /etc/tomcat6/tomcat6.conf
JAVA_HOME="/etc/alternatives/jre"
CATALINA_BASE="/usr/share/tomcat6"
CATALINA_HOME="/usr/share/tomcat6"
JASPER_HOME="/usr/share/tomcat6"
CATALINA_TMPDIR="/var/cache/tomcat6/temp"
TOMCAT_USER="tomcat"
SECURITY_MANAGER="false"
SHUTDOWN_WAIT="30"
SHUTDOWN_VERBOSE="false"
CATALINA_PID="/var/run/tomcat6.pid"
Comment 15 Iron Bone 2009-02-25 18:27:14 UTC
Additionally in /usr/bin/dtomcat6: line 22:  I have

${CATALINA_BASE}/logs/catalina.out

It seams  ${CATALINA_BASE} is empty
Comment 16 Michal Vyskocil 2009-03-16 14:57:35 UTC
Only a dtomcat6 start don't work on my station. The rctomcat6 start works on all configurations.

I'm working on merge of sysconfig and tomcat6.conf
Comment 17 Forgotten User QPz6RCyXU0 2009-03-16 15:23:08 UTC
(In reply to comment #16)
> Only a dtomcat6 start don't work on my station. The rctomcat6 start works on
> all configurations.

That makes me wonder, why is it that we see this problem? I can repeat this on any of our opensuse 11.1 machines, with the basic default configuration. 
 
> I'm working on merge of sysconfig and tomcat6.conf

That would be great, if we could see a uniform set of configuration files. Right now it's a bit of a mess, and one doesn't know which config file actually matters.

Thanks for looking into this.
Comment 18 Michal Vyskocil 2009-03-17 08:54:29 UTC
As a workaround, you should remove the following comments in /usr/bin/dtomcat6

# Don't read a conf file again - bnc#446598
#if [ -z "${TOMCAT_CFG}" ]; then
#    TOMCAT_CFG="/etc/tomcat6/tomcat6.conf"
#fi

This should helps and CATALINA_BASE might be read in proper way.
Comment 19 Michal Vyskocil 2009-03-17 10:18:01 UTC
JFI: The tomcat6 in %post script merges a config from /etc/sysconfig/tomcat6 to /etc/tomcat6/tomcat6.conf and saves a copy of sysconfig script to /etc/tomcat6/tomcat6.sysconfig.save

The rules are following:
When the same variable is defined in tomcat6.conf, add commented sysconfig value. When the variable is not defined in tomcat6.conf, just add it.

Merged variables are JAVA_HOME, JAVA_OPTS, CATALINA_OPTS. The TOMCAT_OPTS is never used in init script and dctomcat6, so it was excluded from merge.
Comment 20 Michal Vyskocil 2009-03-17 10:19:07 UTC
Reassing to me, fixed in Factory.
Comment 21 Iron Bone 2009-03-28 12:30:46 UTC
One more remark. After changes given in Comment #18 tomcat work but only when IPv6 is disabled. When enabling IPv6 tomcat starts but have problems with opening socket. I found information about it also of ubuntu forums - so it must be tomcat specific problem.
Comment 22 Michal Vyskocil 2009-03-30 09:49:38 UTC
Can you please fill a new bug against tomcat6 and ipv6?
Comment 23 Michal Vyskocil 2009-06-08 12:03:49 UTC
(In reply to comment #20)
> Reassing to me, fixed in Factory.

Lets close this bug - the sysconfig will be removed in openSUSE 11.2+