Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jsch error return codes not consistent

Tags:

java

ssh

I am using the nice http://www.jcraft.com/jsch/ library - however when I run some commands, I see that jsch returns a getExitStatus of -1, from time to time, even though the script ran fine (when I run it by hand it is consistently a successful 0 exit code). Any ideas?

(seems to happen to a wide variety of commands)

like image 975
Michael Neale Avatar asked Jul 01 '10 03:07

Michael Neale


1 Answers

I gave up on Jsch - and its incredibly unhelpful API and switched to:

http://www.cleondris.ch/opensource/ssh2/

(Ganymede SSH2). I do a LOT with ssh in the JVM and over months of 24 hour usage ganymede has proven far more reliable. And more pleasant. My main remaining gripe is around being apparently unable to set timeouts for SCP.

like image 58
Michael Neale Avatar answered Oct 05 '22 20:10

Michael Neale