messagebus diagnostics process path on Mac OS

This commit is contained in:
Kuba Brecka 2013-03-08 16:46:23 +01:00
parent fb573b917f
commit bdeef4696f

View File

@ -1,8 +1,13 @@
class MessageBus::Diagnostics
def self.full_process_path
begin
info = `ps -eo "%p|$|%a" | grep '^\\s*#{Process.pid}'`
info.strip.split('|$|')[1]
system = `uname`.strip
if system == "Darwin"
`ps -o "comm=" -p #{Process.pid}`
else
info = `ps -eo "%p|$|%a" | grep '^\\s*#{Process.pid}'`
info.strip.split('|$|')[1]
end
rescue
# skip it ... not linux or something weird
end