396569 - 'bin/jetty.sh stop' reports 'OK' even when jetty was not

running 

+ Validating PID file and contents a bit more
This commit is contained in:
Joakim Erdfelt 2014-09-24 12:54:38 -07:00
parent 45bcb6df3a
commit ab58438600
1 changed files with 9 additions and 0 deletions

View File

@ -499,7 +499,16 @@ case "$ACTION" in
rm -f "$JETTY_PID"
echo OK
else
if [ ! -f "$JETTY_PID" ] ; then
echo "ERROR: no pid found at $JETTY_PID"
exit 1
fi
PID=$(cat "$JETTY_PID" 2>/dev/null)
if [ -z "$PID" ] ; then
echo "ERROR: no pid id found in $JETTY_PID"
exit 1
fi
kill "$PID" 2>/dev/null
TIMEOUT=30