Missing pid file check in tomcat6 init script causes failed startup
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.
# Run the catalina.sh script as a daemon
set +e
touch "$CATALINA_PID" "$CATALINA_
chown $TOMCAT6_USER "$CATALINA_PID" "$CATALINA_
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
ProcVersionSign
Uname: Linux 2.6.32-25-server x86_64
Architecture: amd64
Date: Tue Nov 16 15:00:06 2010
PackageArchitec
ProcEnviron:
PATH=(custom, no user)
LANG=en_GB.UTF-8
SHELL=/bin/bash
SourcePackage: tomcat6