Missing pid file check in tomcat6 init script causes failed startup

Bug #676094 reported by Max
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tomcat6 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: tomcat6

The tomcat6 init script does not pass the --pid-file argument to start-stop-daemon when it launches tomcat. This causes start-stop-daemon to look for processes with matching names, uids and gids when trying to determine if tomcat is already running. Due to the way the tomcat6 init script is written, this means that tomcat will not start if an existing instance of /bin/bash is running with the same user and group as that which tomcat runs as.

The offending lines are in 148-154 of /etc/init.d/tomcat6:
  # Run the catalina.sh script as a daemon
  set +e
  touch "$CATALINA_PID" "$CATALINA_BASE"/logs/catalina.out
  chown $TOMCAT6_USER "$CATALINA_PID" "$CATALINA_BASE"/logs/catalina.out
  start-stop-daemon --start -u "$TOMCAT6_USER" -g "$TOMCAT6_GROUP" \
          -c "$TOMCAT6_USER" -d "$CATALINA_TMPDIR" \
          -x /bin/bash -- -c "$AUTHBIND_COMMAND $TOMCAT_SH"

$TOMCAT_SH causes catalina.sh to be run, which maintains the pid file. However, start-stop-daemon is unaware of this pid file. Other uses of start-stop-daemon in the init script pass the --pid-file option. Can it just be added to this one?

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: tomcat6 6.0.24-2ubuntu1.4
ProcVersionSignature: Ubuntu 2.6.32-25.45-server 2.6.32.21+drm33.7
Uname: Linux 2.6.32-25-server x86_64
Architecture: amd64
Date: Tue Nov 16 15:00:06 2010
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: tomcat6

Revision history for this message
Max (mjs510) wrote :
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.