The Tomcat 5.0.27-r4 install works just fine, but both the catalina.sh and the startup.sh scripts in /opt/tomcat5/bin/ don't work. However, if I run the startup-using-launcher.sh script it does startup correctly. Reproducible: Always Steps to Reproduce: Run /etc/init.d/tomcat5 start or /opt/tomcat5/bin/startup.sh or /opt/tomcat5/bin/catalina.sh Actual Results: When the catalina.sh script is run I can see a bunch of blackdown processes start but after a second or two they all stop. Same thing happens with the startup.sh script. Expected Results: Tomcat should have started and bound itself to port 8080. Portage 2.0.51-r14 (default-linux/x86/2004.3, gcc-3.3.5, glibc-2.3.4.20040808-r1, 2.6.10-hardened-r3 i686) ================================================================= System uname: 2.6.10-hardened-r3 i686 Pentium III (Coppermine) Gentoo Base System version 1.4.16 Python: dev-lang/python-2.3.4 [2.3.4 (#1, Nov 7 2004, 18:14:59)] dev-lang/python: 2.3.4 sys-devel/autoconf: 2.59-r5 sys-devel/automake: 1.8.5-r1 sys-devel/binutils: 2.15.92.0.2-r1 sys-devel/libtool: 1.5.2-r7 virtual/os-headers: 2.4.21-r1 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O3 -mcpu=pentium3 -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/alias /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O3 -mcpu=pentium3 -fomit-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms" GENTOO_MIRRORS="http://128.213.5.34/gentoo/ http://open-systems.ufl.edu/mirrors/gentoo http://mirror.datapipe.net/gentoo http://gentoo.chem.wisc.edu/gentoo/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 apache2 apm arts avi berkdb bitmap-fonts crypt cups encode f77 font-server foomaticdb fortran gdbm gif gnome gpm imagemagick imlib ipv6 jpeg junit kde libg++ libwww mad mikmod motif mpeg mysql ncurses nls oggvorbis opengl oss pam pdflib perl php png python quicktime readline samba sdl slang spell ssl svga tcpd tiff truetype truetype-fonts type1-fonts xml2 xmms xv zlib" Unset: ASFLAGS, CBUILD, CTARGET, LDFLAGS, PORTDIR_OVERLAY
I noticed from the log file that tomcat was looking for jmx but not finding it. So I decided install jmx. Now I'm at least getting errors in the log: WARNING: Unexpected exception resolving reference java.io.FileNotFoundException: /opt/tomcat5/conf/tomcat-users.xml (Permission denied) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) at org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:354) at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:97) at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:129) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301) at org.apache.naming.NamingContext.lookup(NamingContext.java:791) at org.apache.naming.NamingContext.lookup(NamingContext.java:151) at org.apache.catalina.realm.UserDatabaseRealm.start(UserDatabaseRealm.java:252) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1075) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) at org.apache.catalina.core.StandardService.start(StandardService.java:480) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) at org.apache.catalina.startup.Catalina.start(Catalina.java:556) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:284) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:422) javax.naming.NamingException: /opt/tomcat5/conf/tomcat-users.xml (Permission denied) at org.apache.naming.NamingContext.lookup(NamingContext.java:803) at org.apache.naming.NamingContext.lookup(NamingContext.java:151) at org.apache.catalina.realm.UserDatabaseRealm.start(UserDatabaseRealm.java:252) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1075) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) at org.apache.catalina.core.StandardService.start(StandardService.java:480) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) at org.apache.catalina.startup.Catalina.start(Catalina.java:556) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:284) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:422) Jan 23, 2005 5:12:37 PM org.apache.catalina.startup.Catalina start SEVERE: Catalina.start: LifecycleException: No UserDatabase component found under key UserDatabase at org.apache.catalina.realm.UserDatabaseRealm.start(UserDatabaseRealm.java:259) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1075) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) at org.apache.catalina.core.StandardService.start(StandardService.java:480) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) at org.apache.catalina.startup.Catalina.start(Catalina.java:556) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:284) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:422) Jan 23, 2005 5:12:37 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 356 ms
I was trying to reproduce your problem on my machine, and I wasn't able to. To me, it seems tomcat is looking for /opt/tomcat5/conf/tomcat-users.xml, and either it doesn't exist, or you don't have the correct permission. Are you running /etc/init.d/tomcat5 start as root? You should run that script as root.
Permissions/Ownership of /etc/tomcat5/ (aka /opt/tomcat5/conf) drwxr-x--- 3 tomcat tomcat 304 Jan 24 11:58 . drwxr-xr-x 55 root root 4040 Jan 24 10:21 .. drwxr-xr-x 3 tomcat tomcat 80 Jan 22 17:11 Catalina -rw-r--r-- 1 tomcat tomcat 6954 Jan 22 17:11 catalina.policy -rw-r--r-- 1 tomcat tomcat 2754 Jan 22 17:11 catalina.properties -rw-r--r-- 1 tomcat tomcat 778 Jan 22 17:11 jk2.properties -rw-r--r-- 1 tomcat tomcat 1128 Jan 22 17:11 server-minimal.xml -rw-r--r-- 1 tomcat tomcat 18715 Jan 22 17:11 server.xml -rw------- 1 tomcat tomcat 296 Jan 24 11:58 tomcat-users.xml -rw-r--r-- 1 tomcat tomcat 38706 Jan 22 17:11 web.xml I did have a problem with my tomcat-users.xml owner/group which is now fixed. I no longer get the crash messages. However, it still doesn't correctly startup. Here is what the output looks like from the log file: Jan 24, 2005 12:32:49 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Jan 24, 2005 12:32:49 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 3248 ms Jan 24, 2005 12:32:50 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Jan 24, 2005 12:32:50 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.0.27 Jan 24, 2005 12:32:50 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Jan 24, 2005 12:32:50 PM org.apache.catalina.core.StandardHost getDeployer INFO: Create Host deployer for direct deployment ( non-jmx ) Jan 24, 2005 12:32:50 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:/etc/tomcat5/Catalina/local I can see java processes startup for a second, but they all shut down eventually. When I change the config to run tomcat5 with the debugger I get this output: run org.apache.catalina.startup.Bootstrap start Set uncaught java.lang.Throwable Set deferred uncaught java.lang.Throwable > VM Started: Jan 24, 2005 12:37:50 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Jan 24, 2005 12:37:51 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 5580 ms Jan 24, 2005 12:37:52 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Jan 24, 2005 12:37:52 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.0.27 Jan 24, 2005 12:37:52 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Jan 24, 2005 12:37:52 PM org.apache.catalina.core.StandardHost getDeployer INFO: Create Host deployer for direct deployment ( non-jmx ) Jan 24, 2005 12:37:52 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:/etc/tomcat5/Catalina/localhost/manager.xml The application has been disconnected [ ok ]
I'm also getting some grsec output... grsec: From 24.98.197.246: signal 11 sent to /opt/blackdown-jdk-1.4.2.01/jre/bin/java[java:31475] uid/euid:103/103 gid/egid:429/429, parent /opt/blackdown-jdk-1.4.2.01/bin/jdb[jdb:13412] uid/euid:103/103 gid/egid:429/429
and that is exactly your problem, grsecurity kills the java binaries at runtime. you have 2 options, either disable grsecurity completly or disable the grsecurity features on your java binaries using chpax or paxctl (see manpages of them how to do this).
Ah... that makes sense. Disabling the memory protection for the java executable worked.