# File lib/daemons/monitor.rb, line 8
    def self.find(dir, app_name)
      pid = PidFile.find_files(dir, app_name, false)[0]
      
      if pid
        pid = PidFile.existing(pid)
        
        unless PidFile.running?(pid.pid)
          begin; pid.cleanup; rescue ::Exception; end
          return
        end
        
        monitor = self.allocate
      
        monitor.instance_variable_set(:@pid, pid)
        
        return monitor
      end
      
      return nil
    end