Be safer before TERMing pids, actually use the override options passed
from the payload, if any.
--- 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