Return-Path: Delivered-To: apmail-incubator-qpid-commits-archive@locus.apache.org Received: (qmail 12398 invoked from network); 5 Apr 2007 13:51:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Apr 2007 13:51:23 -0000 Received: (qmail 775 invoked by uid 500); 5 Apr 2007 13:51:25 -0000 Delivered-To: apmail-incubator-qpid-commits-archive@incubator.apache.org Received: (qmail 764 invoked by uid 500); 5 Apr 2007 13:51:25 -0000 Mailing-List: contact qpid-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: qpid-dev@incubator.apache.org Delivered-To: mailing list qpid-commits@incubator.apache.org Received: (qmail 755 invoked by uid 99); 5 Apr 2007 13:51:24 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Apr 2007 06:51:24 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Apr 2007 06:51:17 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 2194E1A9838; Thu, 5 Apr 2007 06:50:57 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r525829 - in /incubator/qpid/branches/M2/java/broker/bin: qpid.stop qpid.stopall Date: Thu, 05 Apr 2007 13:50:57 -0000 To: qpid-commits@incubator.apache.org From: ritchiem@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070405135057.2194E1A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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"