Tomcat 6 start up fails with unknown dir /var/lib/tomcat6/work

Bug #915089 reported by Mike Amos
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tomcat6 (Ubuntu)
Won't Fix
Medium
Unassigned

Bug Description

Post-install, system start and start form logged in user fail.
Package information: tomcat6 (6.0.28-10ubuntu2.2)

Installed Ubuntu release with current updates applied earlier today:
You are using Ubuntu 11.04 - the Natty Narwhal - released in April 2011 and supported until October 2012.

This same message is also seen in the installation logs. I did not find the message in the system logs following a system restart.
root@SBSDT16:/var/lib/tomcat6# service tomcat6 start
 * Starting Tomcat servlet engine tomcat6 /etc/init.d/tomcat6: 262: cannot create /var/lib/tomcat6/work/catalina.policy: Directory nonexistent

root@SBSDT16:/var/lib/tomcat6# ls -l
total 16
drwxr-xr-x 3 tomcat6 tomcat6 4096 2012-01-11 17:05 common
lrwxrwxrwx 1 root root 12 2012-01-11 17:05 conf -> /etc/tomcat6
lrwxrwxrwx 1 root root 17 2012-01-11 17:05 logs -> ../../log/tomcat6
drwxr-xr-x 3 tomcat6 tomcat6 4096 2012-01-11 17:05 server
drwxr-xr-x 3 tomcat6 tomcat6 4096 2012-01-11 17:05 shared
drwxrwxr-x 4 tomcat6 tomcat6 4096 2012-01-11 17:05 webapps
lrwxrwxrwx 1 root root 19 2012-01-11 17:05 work -> ../../cache/tomcat6

The logs and work links are broken. The broken links appear to be due to use of a relative path relative to /var/lib which is, itself, a link.
root@SBSDT16:/var/lib/tomcat6# ls -l /var/lib
lrwxrwxrwx 1 root root 13 2011-10-14 10:09 /var/lib -> /home/var-lib

Doing 'ls ../../' lists the contents of /home, not /var.

The tomcat6 installation worked with an earlier release/update version of Ubuntu. Unfortunately, I cannot supply the release/update information for either the OS or tomcat6.

I verified the installed package information in Synaptic Package Manager against information found in
http://packages.ubuntu.com/natty/tomcat6 titled Package: tomcat6 (6.0.28-10ubuntu2.2)

An online Google search and search within Ubuntu resulted on one hit regarding a similar problem. The fix was to uninstall and then re-install tomcat6. I completely uninstalled tomcat6, manually unlined the broken links and then re-installed tomcat6 using the Synaptic Package Manager. The problem persisted and was not fixed.

This problem in no way affects security.

Revision history for this message
Mike Amos (mikeamos777) wrote :

Changing the broken links to a symbolic link using an absolute path allowed starting the tomcat6 service.

root@SBSDT16:/var/lib/tomcat6# ls -l
total 16
drwxr-xr-x 3 tomcat6 tomcat6 4096 2012-01-11 17:05 common
lrwxrwxrwx 1 root root 12 2012-01-11 17:05 conf -> /etc/tomcat6
lrwxrwxrwx 1 root root 16 2012-01-11 18:43 logs -> /var/log/tomcat6
drwxr-xr-x 3 tomcat6 tomcat6 4096 2012-01-11 17:05 server
drwxr-xr-x 3 tomcat6 tomcat6 4096 2012-01-11 17:05 shared
drwxrwxr-x 4 tomcat6 tomcat6 4096 2012-01-11 17:05 webapps
lrwxrwxrwx 1 root root 18 2012-01-11 18:43 work -> /var/cache/tomcat6
root@SBSDT16:/var/lib/tomcat6# service tomcat6 start
 * Starting Tomcat servlet engine tomcat6 [ OK ]
root@SBSDT16:/var/lib/tomcat6# ps -elf | grep tomcat
0 S tomcat6 5460 1 70 80 0 - 157654 futex_ 18:45 ? 00:00:25 /usr/lib/jvm/java-6-openjdk/bin/java -Djava.util.logging.config.file=/var/lib/tomcat6/conf/logging.properties -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/share/tomcat6/endorsed -classpath /usr/share/tomcat6/bin/bootstrap.jar -Dcatalina.base=/var/lib/tomcat6 -Dcatalina.home=/usr/share/tomcat6 -Djava.io.tmpdir=/tmp/tomcat6-tmp org.apache.catalina.startup.Bootstrap start
0 S root 5524 4481 0 80 0 - 2285 pipe_w 18:46 pts/0 00:00:00 grep tomcat

Dave Walker (davewalker)
Changed in tomcat6 (Ubuntu):
importance: Undecided → Medium
Revision history for this message
James Page (james-page) wrote :

I checked this out and all versions of the tomcat6 package in natty (and all other releases) create relative paths for these links as part of the package build process.

This is in compliance with Debian Policy; I also don't believe that separating the sub-directories of /var is actually in compliance with the FHS standard that Debian/Ubuntu follows - see http://www.pathname.com/fhs/pub/fhs-2.3.html#THEVARHIERARCHY.

Marking 'Won't Fix'.

Changed in tomcat6 (Ubuntu):
status: New → Won't Fix
Revision history for this message
Mike Amos (mikeamos777) wrote :

The problem is not that relative directories are used. Use of relative directories is correct and consistent with the standard. The problem is that with the current Debian/Ubuntu/Natty installation of Tomcat6, the links to the relative directory were broken. The workaround that I provided in my 2012-01-11 comment correctly makes symbolic links to the relative directories active. It neither makes the links hard links nor moves the directories to an absolute location.

Without this change, Tomcat6 does did work. Why will you not fix the bad links problem. Non-technical users will not have the ability to find and repair the result of this incomplete installation and will not be able to use packages dependent on Tomcat6.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.