Code in question is a shell script which invokes ssh on a remote system. A non-zero (-1) return code results, however it appears the ssh does work. The function of the ssh is to kick off another shell script on a remote system which in turn invokes an scp on the originating system. The file that is requested by the scp is always present on the remote server. Finally, after several attempts, a zero return code is returned. I turned on verbose mode and compared the logged messages from a successful attempt against the logged messages from the failed attempts and saw no differences. What exactly is the meaning of a -1 Exit Status?
exit(255) usually happens on fatal errors. how can i reproduce your problem?
Duplicating the bug: Server A issues an ssh to Server B. The ssh kicks off a script on Server B. The script on Server B scp's a file from Server A and stores it on Server B. Run this repeatedly so see if any -1 exit status codes are seen, even though the scp appears to function. Note: I happened to notice the ssh verion on these pair of servers is OpenSSH 2.9.2. I thought I saw something somewhere where 2.9.2 returns inconsistent exit status codes.
this works fine for me: rm -f /tmp/ls2 while date; do ssh -oBatchMode=yes -A localhost \ scp localhost:/bin/ls /tmp/ls2 if [ $? -ne 0 ]; then echo ssh failed fi cmp /tmp/ls2 /bin/ls if [ $? -ne 0 ]; then echo scp failed fi rm -f /tmp/ls2 done
This is probably a dupe of bug #341 which has not been sighted for a long while (version-wise).
Thinking about it this might be a variant of bug #375. If so it's been fixed since 3.6p1, so please try to replicate with the latest version (3.6.1p2). Previously sshd would deref some random location right at the end of the session which would account for the random nature. If this is the case you'll see Software Program errors in "errpt -a" on AIX in at least some cases.
Will instruct user to upgrade SSH version. This problem has not surfaced on any other installations running more current SSH levels. *** This bug has been marked as a duplicate of 341 ***
Mass change of RESOLVED bugs to CLOSED