# File monit/lib/symbiosis/monitor/process.rb, line 37 def name pid = self.pid raise "Cannot find pid" if pid.nil? statusfile = File.join("", "proc", pid, "status") # # Raise a no-such-process error if the status file doesn't exist. # raise Errno::ESRCH, self.pid unless File.exists?(statusfile) # # Read the status file and find the name. # name = nil File.readlines(statusfile).find{|l| l.chomp =~ /^Name:\s+(.*)$/ } name = $1 unless $1.nil? raise Errno::ESRCH, self.pid if name.nil? name end