From 72f6f2616a007e208649c30e0d841215391ca754 Mon Sep 17 00:00:00 2001 From: Tom Preston-Werner Date: Thu, 1 Nov 2007 11:12:59 -0700 Subject: [PATCH] propogate netlink status to process exits condition --- lib/god/conditions/process_exits.rb | 3 ++- lib/god/event_handler.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/god/conditions/process_exits.rb b/lib/god/conditions/process_exits.rb index 40d33aa..787df20 100644 --- a/lib/god/conditions/process_exits.rb +++ b/lib/god/conditions/process_exits.rb @@ -16,7 +16,8 @@ module God pid = File.read(self.watch.pid_file).strip.to_i begin - EventHandler.register(pid, :proc_exit) do + EventHandler.register(pid, :proc_exit) do |extra| + self.info = "process exited #{extra.inspect}" Hub.trigger(self) end rescue StandardError diff --git a/lib/god/event_handler.rb b/lib/god/event_handler.rb index 74012cf..8a402fa 100644 --- a/lib/god/event_handler.rb +++ b/lib/god/event_handler.rb @@ -51,7 +51,7 @@ module God end def self.call(pid, event, extra_data = {}) - @@actions[pid][event].call if watching_pid?(pid) && @@actions[pid][event] + @@actions[pid][event].call(extra_data) if watching_pid?(pid) && @@actions[pid][event] end def self.watching_pid?(pid) -- 2.11.4.GIT