diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2011-07-15 11:24:42 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2011-07-15 11:24:42 +0100 |
commit | fe3e2b20ae99b3f65284c6eaf3c2fdb1c2a4cebc (patch) | |
tree | 75d22b305171f41800bb22076a37d8f6537502ac | |
parent | 6ee924134ce95a4f081e93ca40c3070f5f65996d (diff) | |
download | rabbitmq-server-fe3e2b20ae99b3f65284c6eaf3c2fdb1c2a4cebc.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.erl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl index b1680d95..9581f850 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 () -> |