If I run the following command on the command line, it executes without difficulty:
crasch$ ssh -l root localhost /Library/FrontBase/bin/FBExec &
[1] 4340
crasch$ ps -aux | grep 'FBExec'
root 4344 0.0 -0.0 28372 460 ?? Ss 1:43PM 0:00.01 /Library/FrontBase/bin/FBExe
If I run the same command in the ruby interpreter, the interpreter hangs until I issue a break command ("Ctrl-C" ) :
irb(main):127:0> %x{ ssh -l root localhost /Library/FrontBase/bin/FBExec & }
^CIRB::Abort: abort then interrupt!!
from /usr/local/lib/ruby/1.8/irb.rb:81:in `irb_abort'
from /usr/local/lib/ruby/1.8/irb.rb:243:in `signal_handle'
from /usr/local/lib/ruby/1.8/irb.rb:66:in `start'
from (irb):127
Although the command hangs, the process is started:
crasch:~/Projects/trunk/DeployScripts crasch$ ps -aux | grep 'FBExec'
root 4282 0.0 -0.0 28372 460 ?? Ss 1:39PM 0:00.01 /Library/FrontBase/bin/FBExec
crasch 4296 0.0 -0.0 27812 4 p1 R+ 1:42PM 0:00.00 grep FBExec
If I run the command after the FBExec process has been started, I get the following message:
irb(main):129:0> %x{ ssh -l root localhost /Library/FrontBase/bin/FBExec & }
=> "2006-07-31 13:53:21 Cannot bind listen socket - FBExec may already be running\n"
The exit code after running the command on the command line is
The same thing happens if I run the command inside a script. I've tried stepping through the command using the debugger, it doesn't appear to be able to step through the command expansion code (at least, I've not figured it out yet).
Note that I can execute the command with
irb(main):137:0> system("ssh -l root localhost /Library/FrontBase/bin/FBExec &")
=> true
Why the discrepancy in behavior? Thanks for any help you may wish to provide.
Chris
···
from :0