1
From: Arto Jantunen <viiru@debian.org>
2
Date: Mon, 28 Jun 2010 21:19:14 +0200
3
Subject: [PATCH] allow empty PID file
6
bin/catalina.sh | 8 ++++++--
7
1 files changed, 6 insertions(+), 2 deletions(-)
9
diff --git a/bin/catalina.sh b/bin/catalina.sh
10
index 2ef2323..5843b56 100755
13
@@ -305,7 +305,7 @@ elif [ "$1" = "run" ]; then
14
elif [ "$1" = "start" ] ; then
16
if [ ! -z "$CATALINA_PID" ]; then
17
- if [ -f "$CATALINA_PID" ]; then
18
+ if [ -s "$CATALINA_PID" ]; then
19
echo "PID file ($CATALINA_PID) found. Is Tomcat still running? Start aborted."
22
@@ -363,12 +363,16 @@ elif [ "$1" = "stop" ] ; then
25
if [ ! -z "$CATALINA_PID" ]; then
26
- if [ -f "$CATALINA_PID" ]; then
27
+ if [ -s "$CATALINA_PID" ]; then
28
kill -0 `cat $CATALINA_PID` >/dev/null 2>&1
30
echo "PID file ($CATALINA_PID) found but no matching process was found. Stop aborted."
33
+ elif [ -f "$CATALINA_PID" ]; then
35
+ echo "\$CATALINA_PID was set ($CATALINA_PID) but the specified file is empty. Did Tomcat fail while starting? Stop aborted."
38
echo "\$CATALINA_PID was set ($CATALINA_PID) but the specified file does not exist. Is Tomcat running? Stop aborted."