From 38f229c5e67f90f99139da91c7fed48d68f8d4bd Mon Sep 17 00:00:00 2001 From: Tom Werner Date: Tue, 7 Aug 2007 18:11:28 -0700 Subject: [PATCH] Fix simple mode lifecycle gap --- History.txt | 2 ++ lib/god/watch.rb | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/History.txt b/History.txt index 78cd995..93714a0 100644 --- a/History.txt +++ b/History.txt @@ -8,6 +8,8 @@ * Implement command line control to start/restart/stop/monitor/unmonitor watches/groups by name * Watches can now belong to a group that can be controlled as a whole * Allow god to be installed (sans events) on systems that don't support events +* Daemonize and handle PID files for non-daemonizing scripts [kevinclark] +* Fix simple mode lifecycle gap == 0.2.1 / diff --git a/lib/god/watch.rb b/lib/god/watch.rb index ec29b0d..be582a4 100644 --- a/lib/god/watch.rb +++ b/lib/god/watch.rb @@ -148,6 +148,11 @@ module God # perform action (if available) self.action(to_state) + # enable simple mode + if [:start, :restart].include?(to_state) && self.metrics[to_state].empty? + to_state = :up + end + # move to new state if to_state self.metrics[to_state].each { |m| m.enable } -- 2.11.4.GIT