From 40ba44b24c4e68aa7337025d94ef7f5b95c3f08a Mon Sep 17 00:00:00 2001 From: Tom Werner Date: Tue, 10 Jul 2007 18:01:20 -0700 Subject: [PATCH] more thoughts on the new config file --- test/configs/test.rb | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/test/configs/test.rb b/test/configs/test.rb index 32f2b69..31f38c1 100644 --- a/test/configs/test.rb +++ b/test/configs/test.rb @@ -19,7 +19,15 @@ God.meddle do |god| b.pid_file = pid_file end - # determine when process has started for real + # determine the state on startup + w.lifecycle(:init, [:up, :start]) do |start| + start.condition(:process_running) do |c| + c.running = true + c.pid_file = pid_file + end + end + + # determine when process has finished starting w.lifecycle([:start, :restart], :up) do |up| up.condition(:http) do |c| @@ -28,11 +36,6 @@ God.meddle do |god| # start if process is not running w.lifecycle(:up, :start) do |start| - start.condition(:process_running) do |c| - c.running = false - c.pid_file = pid_file - end - start.condition(:process_exits) do |c| c.pid_file = pid_file end @@ -69,4 +72,8 @@ God.meddle do |god| # start.condition(:always) # end # end -end \ No newline at end of file +end + +__END__ + +init -> start -> up -> \ No newline at end of file -- 2.11.4.GIT