You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ri...@apache.org on 2007/04/05 15:50:57 UTC

svn commit: r525829 - in /incubator/qpid/branches/M2/java/broker/bin: qpid.stop qpid.stopall

Author: ritchiem
Date: Thu Apr  5 06:50:56 2007
New Revision: 525829

URL: http://svn.apache.org/viewvc?view=rev&rev=525829
Log:
Updated scripts to work correctly under solaris and bash 2.0

Modified:
    incubator/qpid/branches/M2/java/broker/bin/qpid.stop
    incubator/qpid/branches/M2/java/broker/bin/qpid.stopall

Modified: incubator/qpid/branches/M2/java/broker/bin/qpid.stop
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/broker/bin/qpid.stop?view=diff&rev=525829&r1=525828&r2=525829
==============================================================================
--- incubator/qpid/branches/M2/java/broker/bin/qpid.stop (original)
+++ incubator/qpid/branches/M2/java/broker/bin/qpid.stop Thu Apr  5 06:50:56 2007
@@ -7,7 +7,7 @@
 
 MAX_ATTEMPTS=1
 SLEEP_DELAY=1
-PROGRAM="org.apache.qpid.server.Main"
+PROGRAM="DQPID"
 
 
 #
@@ -15,7 +15,8 @@
 #
 printActions()
 {
-ps=`ps o command p $1|grep $PROGRAM`
+#ps=`ps o command p $1|grep $PROGRAM`
+ps=`ps -o args -p $1|grep $PROGRAM`
 echo "Attempting to kill: $ps"
 }
 
@@ -41,7 +42,7 @@
 #
 lookup()
 {
-result=`ps p $1 |grep -v grep |grep $PROGRAM |wc -l`
+result=`ps -o args -p $1 |grep -v grep |grep $PROGRAM |wc -l`
 }
 
 #
@@ -62,7 +63,7 @@
 verifyPid()
 {
 lookup $1
-if [[ $result == 1 ]] ; then	
+if [[ $[$result] == 1 ]] ; then
  brokerspid=$1
 else
  echo "Unable to locate Qpid Process with PID $1"
@@ -87,21 +88,21 @@
 
 # Attempt to quit the process MAX_ATTEMPTS Times
 attempt=0
-while [[ $result > 0 && $attempt < $MAX_ATTEMPTS ]] ; do
+while [[ $[$result] > 0 && $[$attempt] < $[$MAX_ATTEMPTS] ]] ; do
  quit $brokerspid
  check $brokerspid
  attempt=$[$attempt + 1]
 done
 
 # Check that it has quit
-if [[ $results == 0 ]] ; then
+if [[ $[$result] == 0 ]] ; then
  echo "Process quit"
  exit 0
 else
 
  # Now attempt to force quit the process
  attempt=0
- while [[ $result > 0 && $attempt < $MAX_ATTEMPTS ]] ; do
+ while [[ $[$result] > 0 && $[$attempt] < $[$MAX_ATTEMPTS] ]] ; do
   forceQuit $brokerspid
   check $brokerspid
   attempt=$[$attempt + 1]
@@ -109,7 +110,7 @@
 
 
  # Output final status
- if [[ $result > 0 && $attempt == $MAX_ATTEMPTS ]] ; then
+ if [[ $[$result] > 0 && $[$attempt] == $[$MAX_ATTEMPTS] ]] ; then
 	echo "Stopped trying to kill process: $brokerspid"
 	echo "Attempted to stop $attempt times"
  else

Modified: incubator/qpid/branches/M2/java/broker/bin/qpid.stopall
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/broker/bin/qpid.stopall?view=diff&rev=525829&r1=525828&r2=525829
==============================================================================
--- incubator/qpid/branches/M2/java/broker/bin/qpid.stopall (original)
+++ incubator/qpid/branches/M2/java/broker/bin/qpid.stopall Thu Apr  5 06:50:56 2007
@@ -6,7 +6,7 @@
 #  Utilises qpid.stop to perform the actual stopping
 #
 
-PROGRAM="org.apache.qpid.server.Main"
+PROGRAM="DQPID"
 
 #
 # grep ps for instances of $PROGRAM and collect PIDs
@@ -14,7 +14,7 @@
 lookup()
 {
 #pids=`ps o pid,command  | grep $PROGRAM | grep -v grep | cut -d ' ' -f 1`
-pids=`ps ugxwww | grep $PROGRAM | grep -v grep | awk '{print $2}'`
+pids=`ps -ef |grep $USER | grep $PROGRAM | grep -v grep | awk '{print $2}'`
 result=`echo -n $pids | wc -w`
 }
 
@@ -24,7 +24,7 @@
 #
 showPids()
 {
-ps p $pids
+ps -o user,pid,args -p $pids
 }
 
 
@@ -34,7 +34,7 @@
 
 lookup
 
-if [[ $result == 0 ]] ; then
+if [[ $[$result] == 0 ]] ; then
  echo "No Qpid Brokers found running under user '$USER'"
  exit 0
 fi
@@ -48,7 +48,7 @@
 # Check we have quit all
 lookup
 
-if [[ $result == 0 ]] ; then
+if [[ $[$result] == 0 ]] ; then
  echo "All Qpid brokers successfully quit"
 else
  echo "Some brokers were not quit"