You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2017/10/23 12:50:55 UTC

qpid-broker-j git commit: QPID-7910: [Java Broker] Replace ps with pgrep.

Repository: qpid-broker-j
Updated Branches:
  refs/heads/master c2661b8e3 -> b2c553784


QPID-7910: [Java Broker] Replace ps with pgrep.


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/b2c55378
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/b2c55378
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/b2c55378

Branch: refs/heads/master
Commit: b2c5537849cd2865ae669ee996edbf38e8eb6890
Parents: c2661b8
Author: Keith Wall <kw...@apache.org>
Authored: Mon Oct 23 13:50:22 2017 +0100
Committer: Keith Wall <kw...@apache.org>
Committed: Mon Oct 23 13:50:22 2017 +0100

----------------------------------------------------------------------
 broker/bin/qpid.stop | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/b2c55378/broker/bin/qpid.stop
----------------------------------------------------------------------
diff --git a/broker/bin/qpid.stop b/broker/bin/qpid.stop
index e01f1da..c55700e 100755
--- a/broker/bin/qpid.stop
+++ b/broker/bin/qpid.stop
@@ -95,10 +95,13 @@ main()
     else
         pids=( "$@" )
         declare -a broker_pids=()
+        pidfile=$(mktemp)
+        trap "rm -f ${pidfile} || true" EXIT
         for pid in "${pids[@]}"
         do
-            ps -f -p $pid | grep -- "${SEARCH}" >/dev/null
-            if [[ "$?" == "0" ]]; then
+            echo ${pid} > ${pidfile}
+            pgrep -f -U "${USER}" -F "${pidfile}" -- "${SEARCH}" >/dev/null
+            if [[ $? -eq 0 ]]; then
                 broker_pids+=($pid)
             else
                 echo "Qpid Broker-J with the PID '$1' is not found"


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org