Skip to content

Commit

Permalink
print message when signal received
Browse files Browse the repository at this point in the history
  • Loading branch information
ddollar committed Sep 20, 2010
1 parent 2a7dadc commit 62b6cac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/foreman/engine.rb
Expand Up @@ -39,17 +39,17 @@ def start(options={})
fork process, options
end

trap("TERM") { kill_all("TERM") }
trap("INT") { kill_all("INT") }
trap("TERM") { puts "SIGTERM received"; kill_all("TERM") }
trap("INT") { puts "SIGINT received"; kill_all("INT") }

watch_for_termination
end

def execute(name, options={})
fork processes[name], options

trap("TERM") { kill_all("TERM") }
trap("INT") { kill_all("INT") }
trap("TERM") { puts "SIGTERM received"; kill_all("TERM") }
trap("INT") { puts "SIGINT received"; kill_all("INT") }

watch_for_termination
end
Expand Down

0 comments on commit 62b6cac

Please sign in to comment.