Author: thomas.diesler(a)jboss.com
Date: 2007-01-30 18:02:39 -0500 (Tue, 30 Jan 2007)
New Revision: 2201
Modified:
branches/jbossws-1.2.0/build/etc/jboss.sh
Log:
Fix stop without pidfile
Modified: branches/jbossws-1.2.0/build/etc/jboss.sh
===================================================================
--- branches/jbossws-1.2.0/build/etc/jboss.sh 2007-01-30 22:33:08 UTC (rev 2200)
+++ branches/jbossws-1.2.0/build/etc/jboss.sh 2007-01-30 23:02:39 UTC (rev 2201)
@@ -27,21 +27,21 @@
sleep 20
;;
stop)
- # $JBOSS_HOME/bin/shutdown.sh -S > /dev/null &
pidfile="$JBOSS_HOME/bin/jboss.pid"
- if [ ! -f "$pidfile" ]; then
- warn "No pid file"
- exit 1
+ if [ -f "$pidfile" ]; then
+ pid=`cat "$pidfile"`
+ echo "kill pid: $pid"
+ kill $pid
+ if [ "$?" -eq 0 ]; then
+ # process exists, wait for it to die, and force if not
+ sleep 20
+ kill -9 $pid &> /dev/null
+ fi
+ rm "$pidfile"
+ else
+ warn "No pid found, using shutdown"
+ $JBOSS_HOME/bin/shutdown.sh -S > /dev/null &
fi
-
- pid=`cat "$pidfile"`
- kill $pid
- if [ "$?" -eq 0 ]; then
- # process exists, wait for it to die, and force if not
- sleep 20
- kill -9 $pid &> /dev/null
- fi
- rm "$pidfile"
;;
restart)
$0 stop
Show replies by date