Well, the problem is that the code hangs during the call to $session->cmd. I actually have tried die("Output is $out"); , as well as writing to the Apache logs after the cmd call, but it just doesn't get there. I tried stepping through it with Komodo, but didn't have enough time today...probably try again tomorrow. The exact same sequence and user environment works as long as Mason isn't involved, and the ssh interaction gets almost to the point where the output is returned from the cmd call...
Here is what the end of the sshd debug should look like (done with the CGI::Application test)
debug3: channel 1: will not send data after close
debug1: channel 1: is dead
debug1: channel 1: garbage collecting
debug1: channel_free: channel 1: server-session, nchannels 2
debug3: channel_free: status: The following connections are open:
#0 server-session (t4 r0 i1/0 o16/0 fd 7/7)
#1 server-session (t4 r1 i8/0 o128/0 fd 8/8)
debug3: channel_close_fds: channel 1: r 8 w 8 e -1
Connection closed by remote host.
debug1: channel_free: channel 0: server-session, nchannels 1
debug3: channel_free: status: The following connections are open:
#0 server-session (t4 r0 i1/0 o16/0 fd 7/7)
debug3: channel_close_fds: channel 0: r 7 w 7 e 9
debug1: session_close: session 0 pid 18607
Closing connection to 192.168.200.231
debug1: Received SIGCHLD.