summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2011-07-15 11:24:42 +0100
committerSimon MacMullen <simon@rabbitmq.com>2011-07-15 11:24:42 +0100
commit16e2bf9e3494fd39e73a31919a359d058b44e023 (patch)
tree75d22b305171f41800bb22076a37d8f6537502ac
parent3c9ea59548401c22c0c5707d1bf5bc4c20b93964 (diff)
downloadrabbitmq-server-git-16e2bf9e3494fd39e73a31919a359d058b44e023.tar.gz
The problem with kill -0 is that its semantics are "could I send a signal to this process?" - i.e. it will fail if the process exists but is not owned by the current user. I think this is not quite what we're looking for, so let's use ps -p. I've tested that ps -p does the right thing on Linux and OS X, and it claims to work on FreeBSD and AIX too according to the manpages on the web. That's probably good enough.
-rw-r--r--src/rabbit_control.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl
index b1680d9571..9581f8506c 100644
--- a/src/rabbit_control.erl
+++ b/src/rabbit_control.erl
@@ -386,7 +386,7 @@ node_up(Node) ->
% rpc:call(os, getpid, []) at this point
pid_up(Pid) ->
with_os([{unix, fun () ->
- system("kill -0 " ++ Pid
+ system("ps -p " ++ Pid
++ " >/dev/null 2>&1") =:= 0
end},
{win32, fun () ->