lib/symphony/tasks/ssh.rb
changeset 7 4321943b8db5
parent 6 5afabb9d8a2c
child 11 ffa70066522c
--- a/lib/symphony/tasks/ssh.rb	Thu May 22 11:38:59 2014 -0700
+++ b/lib/symphony/tasks/ssh.rb	Wed May 28 11:39:58 2014 -0700
@@ -137,7 +137,7 @@
 
 		cmd = []
 		cmd << Symphony::Task::SSH.path
-		cmd += Symphony::Task::SSH.opts
+		cmd += opts
 
 		cmd << '-p' << port.to_s
 		cmd << '-i' << key if key
@@ -162,7 +162,8 @@
 
 	ensure
 		if pid
-			Process.kill( :TERM, pid )
+			active = Process.kill( 0, pid ) rescue false
+			Process.kill( :TERM, pid ) if active
 			pid, status = Process.waitpid2( pid )
 		end
 		return status