From c2000484bb5db9c3bb1416d3a0fd069241d283a3 Mon Sep 17 00:00:00 2001 From: David Dollar Date: Tue, 22 Jun 2010 17:19:47 -0400 Subject: [PATCH] capture PTY::ChildExited --- lib/foreman/engine.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/foreman/engine.rb b/lib/foreman/engine.rb index 42cca0f..f15d507 100644 --- a/lib/foreman/engine.rb +++ b/lib/foreman/engine.rb @@ -77,10 +77,14 @@ private ###################################################################### FileUtils.mkdir_p "log" command = process.command - PTY.spawn("#{process.command} 2>&1") do |stdin, stdout, pid| - until stdin.eof? - info stdin.gets, process + begin + PTY.spawn("#{process.command} 2>&1") do |stdin, stdout, pid| + until stdin.eof? + info stdin.gets, process + end end + rescue PTY::ChildExited + # exited end end end