mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 01:56:01 -05:00
Merge pull request #397 from kubabrecka/fix_ps_warning
messagebus diagnostics process path on Mac OS
This commit is contained in:
commit
84b240e832
1 changed files with 7 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue