4 class ProcessExits < EventCondition
6 self.info = "process exited"
11 valid &= complain("Attribute 'pid_file' must be specified", self) if self.watch.pid_file.nil?
16 pid = File.read(self.watch.pid_file).strip.to_i
19 EventHandler.register(pid, :proc_exit) do |extra|
20 self.info = "process exited #{extra.inspect}"
24 raise EventRegistrationFailedError.new
29 if File.exist?(self.watch.pid_file)
30 pid = File.read(self.watch.pid_file).strip.to_i
31 EventHandler.deregister(pid, :proc_exit)
33 applog(self.watch, :error, "#{self.watch.name} could not deregister: no such PID file #{self.watch.pid_file} (#{self.base_name})")