Merge pull request #799 from Supermathie/freebsd-ps

message_bus: support ps on FreeBSD
This commit is contained in:
Sam 2013-05-01 16:34:31 -07:00
commit 10a3374cf4
1 changed files with 2 additions and 0 deletions

View File

@ -4,6 +4,8 @@ class MessageBus::Diagnostics
system = `uname`.strip
if system == "Darwin"
`ps -o "comm=" -p #{Process.pid}`
elsif system == "FreeBSD"
`ps -o command -p #{Process.pid}`.split("\n",2)[1].strip()
else
info = `ps -eo "%p|$|%a" | grep '^\\s*#{Process.pid}'`
info.strip.split('|$|')[1]