Zombie killer. Make sure we reap our children, even if they are
authorMahlon E. Smith <mahlon@martini.nu>
Fri, 16 May 2014 08:28:27 -0700
changeset 5 6177a734f764
parent 4 3972315383b3
child 6 5afabb9d8a2c
Zombie killer. Make sure we reap our children, even if they are misbehaving.
lib/symphony/tasks/ssh.rb
--- a/lib/symphony/tasks/ssh.rb	Tue May 13 14:38:21 2014 -0700
+++ b/lib/symphony/tasks/ssh.rb	Fri May 16 08:28:27 2014 -0700
@@ -158,7 +158,10 @@
 		@output = @output.split("\n").reject{|l| l =~ SSH_CLEANUP }.join
 		self.log.debug "  run block done."
 
-		pid, status = Process.waitpid2( pid )
+		status = nil
+
+	ensure
+		pid, status = Process.waitpid2( pid ) if pid
 		return status
 	end