def test
self.info = []
unless File.exist?(self.watch.pid_file)
self.info << "#{self.watch.name} #{self.class.name}: no such pid file: #{self.watch.pid_file}"
return !self.running
end
pid = File.read(self.watch.pid_file).strip
active = System::Process.new(pid).exists?
if (self.running && active)
self.info << "process is running"
true
elsif (!self.running && !active)
self.info << "process is not running"
true
else
if self.running
self.info << "process is not running"
else
self.info << "process is running"
end
false
end
end