Hi All,

I have a question about how to debug a Jsch session.

The application opens a single Jsch Session and creates multiple 
ChannelExecs from it to run commands and process results. The commands 
are run serially and synchronously from a single thread. The command and 
result processing are patterned after 
http://www.jcraft.com/jsch/examples/Exec.java. In a situation that I can 
reproduce deterministically in my application but not in any test 
framework, a command that should return results with a zero exit code 
returns no results with a zero exit code.

The command is a script that searches a system file, but I can get the 
same results if the command is "echo foo" (in other words, when I submit 
"echo foo" with a ChannelExec, isClosed() returns true, getExitStatus() 
returns zero, but no data is ever available on the input streams 
returned by getInputStream() or getErrStream()).

I suspect that the problem is on the server side, not with Jsch, but I 
can't figure out how to verify this. What I wish is there was a trace 
flag that would show the commands and responses to/from the server. I 
tried setting up a Logger as in 
http://www.jcraft.com/jsch/examples/Logger.java. It gave me information 
about the session setup, but no command/response traffic.

Does anyone have a suggestion for how to debug this?

Client is jsch-0.1.46 running on Android 2.3. Server is dd-wrt v24-sp2. 
I think the SSH server is dropbear 0.52, and the shell is busybox 1.13.4.

Thanks,

nat



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to