[ https://issues.apache.org/jira/browse/KARAF-6895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17227933#comment-17227933 ]
ASF subversion and git services commented on KARAF-6895: -------------------------------------------------------- Commit f2390932238c7c8329a8e002f6918a9ec441cd18 in karaf's branch refs/heads/master from Jean-Baptiste Onofré [ https://gitbox.apache.org/repos/asf?p=karaf.git;h=f239093 ] Merge pull request #1247 from jbonofre/KARAF-6895 [KARAF-6895] Fix return status for SSH command > ssh-commands not properly return > -------------------------------- > > Key: KARAF-6895 > URL: https://issues.apache.org/jira/browse/KARAF-6895 > Project: Karaf > Issue Type: Bug > Components: karaf > Affects Versions: 4.3.0 > Reporter: Tim B. > Assignee: Jean-Baptiste Onofré > Priority: Major > > Hi Karaf-Team, > after updating from Karaf 4.2.8 to Karaf 4.3.0 most of our automation scripts > doesn't work anymore. > When we execute a command via ssh, the prompt doesn't return properly. > {code:java} > tb@jenkins:~$ ssh -p 8101 karaf@vm1 'info | grep "Karaf version"' > Password authentication > Password: > Karaf version 4.3.0 > {code} > The relevant part is after the result of the command, the bash didn't return. > I have to press ctrl+c or something similar to get back to bash (or wait for > a timeout). > On Karaf 4.2.0 the ssh immediatly returned after executing the command: > {code:java} > tb@jenkins:~$ ssh -p 8101 karaf@vm1 'info | grep "Karaf version"' > Password authentication > Password: > Karaf version 4.2.8 > tb@jenkins:~$ > {code} > I have fixed this by editing the finally block at the end of > _org.apache.karaf.shell.ssh.ShellCommand#run_ from > {code:java} > } finally { > StreamUtils.close(in, out, err); > callback.onExit(exitStatus); > } > {code} > to > {code:java} > } finally { > callback.onExit(exitStatus); > StreamUtils.close(in, out, err); > } > {code} > callback.onExit needs to write into the out-Stream. So it throws an Exception > when it was closed before. > -- This message was sent by Atlassian Jira (v8.3.4#803005)