def running?
      logs = Log.where(:file => file, 
                       :job_type => job_type, 
                       :state => "running",
                       :export_id => export_id,
                       :hostname => hostname)
  
      if logs.count > 0
        logs.each do |log|
          begin
            Process.getpgid(log.pid)
            puts "still running #{log.file}"
            return true
          rescue Errno::ESRCH
            log.mark_dead
          end
        end
      end
      
      return false
    end
def running?
      logs = Log.where(:file => file, 
                       :job_type => job_type, 
                       :state => "running",
                       :export_id => export_id,
                       :hostname => hostname)
  
      if logs.count > 0
        logs.each do |log|
          begin
            Process.getpgid(log.pid)
            puts "still running #{log.file}"
            return true
          rescue Errno::ESRCH
            log.mark_dead
          end
        end
      end
      
      return false
    end
Checks to see if the PID of the log is active or not