Re: [JSch-users] Multiple exec channels during the lifetime of a session
Status: Alpha
Brought to you by:
ymnk
From: Daniel F. F. <dan...@te...> - 2007-01-22 12:30:04
|
Hi Norbert, I have experienced this error already. After some investigations, I got=20 following conclusion. I was running several applications concurrently on the same connection=20 using different exec channels. On some OpenSSH servers, like on Fedora Core 5, I could create only=20 about 10 simultaneous exec channels, where on Ubuntu I could open as=20 many as I wanted. But I could not find any relationship with the OpenSSH=20 server version or Linux distro. The error was exactly the same you=20 described. Then, I discovered that the problem is not related to the number of exec=20 channels, but with number of ptys allocated for the session. Check if=20 your exec channel does ask for a PTY by calling=20 channelExec.setPty(true). I noticed that I could create about 8 channels=20 with pty, then, on further new exec channels, I received the error your=20 mentioned. In order to open any new exec channel, _even channels that do=20 not request PTY_, the command execution failed. I had to closed some=20 other channel with PTY to be able to create new channels. While I requested less than 8 exec channels with PTY, I could create as=20 many other without PTY as I wanted. I tested up to 150 simultaneously. I dont think this is a Jsch problem, but I had not the opportunity to=20 test with another ssh implementation. Do you think you could test the PTYs? I am really curious to find the=20 source of this problem. Best regards, Daniel Felix Ferber Norbert Podhorszki escreveu: > Hi, > > I am using JSch to execute commands on remote machines. Since I have to= =20 > deal with machines protected with one-time-passwords, the code opens a=20 > session once and uses it to execute all commands afterwards. For each=20 > command, a separate channel is opened which is then disconnected after = the=20 > command is executed. > > This has always worked fine until today when I faced two new machines.=20 > After exactly 10 successful command executions, I get an exit code 1 ba= ck=20 > from the channel (channel.getExitStatus()) for the 11th command and for= =20 > all consecutive ones. The command (any command, e.g. echo) is not execu= ted=20 > at all, so this error code comes from something else on the way. > > The new remote machines have the same openss[hl] packages: > OpenSSH_4.1p1, OpenSSL 0.9.7d 17 Mar 2004 > My code has not met such a config yet, but worked fine with several=20 > combinations of 3.* and 4.* openssh and 0.9.7f and 0.9.8[ad] openssl=20 > packages. > > Do you have any idea, what can be the reason behind this? > > Thanks in advance, > Norbert > > > Norbert Podhorszki > ------------------------------------ > University of California, Davis > Department of Computer Science > 1 Shields Ave, 2236 Kemper Hall > Davis, CA 95616 > (530) 752-5076 > pno...@cs... > ---------------------------------- > > -----------------------------------------------------------------------= -- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share= your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > JSch-users mailing list > JSc...@li... > https://lists.sourceforge.net/lists/listinfo/jsch-users > > Esta mensagem foi verificada pelo E-mail Protegido Terra. > Scan engine: McAfee VirusScan / Atualizado em 19/01/2007 / Vers=E3o: 5.= 1.00/4943 > Proteja o seu e-mail Terra: http://mail.terra.com.br/ > =20 |