Hi,
I am trying to upgrade to 6.0.26 and noticed that the startup scripts have
changed slightly. One of the issues that I am having is that the new
catalina.sh startup script now checks for the existance of the CATALINA_PID
file prior to starting up, and if it exists, it aborts.
My problem is that I am creating my pid file in my /var/run directory, which
is, by default/design, root access only. However, I launch the catalina.sh
startup script under a "tomcat" user that has very limited read/write access
on the system.
So what my init.d script currently does is pre-create an empty pid file in
the /var/run directory, then changes ownership of it to "tomcat" so that
tomcat can then update it with the actual pid of the tomcat process.
Given that there is no way for the startup script to write to the /var/run
directory, my options are fairly limited without modifying it. 1) Change
the location of the pid file. 2) Make the /var/run directory tomcat
writable by default (via acl or by mode permissions) Neither option
particularly appeals to me.
The fastest solution I have come up with is to modify the condition in the
catalina.sh script to check for the existence of a non-empty PID file,
instead of just the existence of it (ie: use -s instead of -f).
ie: modify the following from:
if [ ! -z "$CATALINA_PID" ]; then
if [ -f "$CATALINA_PID" ]; then
echo "PID file ($CATALINA_PID) found. Is Tomcat still running? Start
aborted."
exit 1
fi
fi
to:
if [ ! -z "$CATALINA_PID" ]; then
if [ -s "$CATALINA_PID" ]; then
echo "PID file ($CATALINA_PID) found. Is Tomcat still running? Start
aborted."
exit 1
fi
fi
Is there a particular reason why this would be a bad implementation? Should
I submit a patch request for catalina.sh with this change?
Thanks,
Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org