diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2007-04-05 13:50:56 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2007-04-05 13:50:56 +0000 |
| commit | 70036a3ac7d3380d559a95921b1092c81e2c23cd (patch) | |
| tree | 52ecabc732fc5ed4a2350464c8f2f1badff25192 /java/broker/bin | |
| parent | c7950f3d513fadc6375c92ef2f61d44d3688c7a0 (diff) | |
| download | qpid-python-70036a3ac7d3380d559a95921b1092c81e2c23cd.tar.gz | |
Updated scripts to work correctly under solaris and bash 2.0
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2@525829 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker/bin')
| -rw-r--r-- | java/broker/bin/qpid.stop | 17 | ||||
| -rw-r--r-- | java/broker/bin/qpid.stopall | 10 |
2 files changed, 14 insertions, 13 deletions
diff --git a/java/broker/bin/qpid.stop b/java/broker/bin/qpid.stop index f3711d4c8e..9193d3c4e1 100644 --- a/java/broker/bin/qpid.stop +++ b/java/broker/bin/qpid.stop @@ -7,7 +7,7 @@ MAX_ATTEMPTS=1 SLEEP_DELAY=1 -PROGRAM="org.apache.qpid.server.Main" +PROGRAM="DQPID" # @@ -15,7 +15,8 @@ PROGRAM="org.apache.qpid.server.Main" # 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 @@ kill $1 # 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 @@ lookup $1 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 @@ printActions $brokerspid # 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 @@ else # 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 diff --git a/java/broker/bin/qpid.stopall b/java/broker/bin/qpid.stopall index 8705825064..2e762bdd50 100644 --- a/java/broker/bin/qpid.stopall +++ b/java/broker/bin/qpid.stopall @@ -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 @@ PROGRAM="org.apache.qpid.server.Main" 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 @@ result=`echo -n $pids | wc -w` # showPids() { -ps p $pids +ps -o user,pid,args -p $pids } @@ -34,7 +34,7 @@ ps p $pids 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 @@ done # 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" |
