Solaris 9 sshd / ssh exit codes

  • Follow


On Solaris 9, with the latest ssh/sshd patches installed ...

  114356-03: SunOS 5.9: /usr/bin/ssh Patch
  113273-06: SunOS 5.9: /usr/lib/ssh/sshd Patch

.... why is there inconsistent behaviour with ssh exit codes?  Why are
there sporadic exit codes of 0 from the following ssh command?

% repeat 100 sh -c 'ssh -n localhost "exit 33" ; echo $?'
33
33
33
33
33
33
33
33
33
33
33
33
33
33
33
33
33
33
33
33
33
0
33
33
33
33
33
0
0
0
0
33
33
33
33
33
33
33
33
33
33
33
^Z
Suspended
0
Reply Juergen 7/8/2004 7:12:15 PM

Juergen Keil <jk@tools.de> writes:


>On Solaris 9, with the latest ssh/sshd patches installed ...

>  114356-03: SunOS 5.9: /usr/bin/ssh Patch
>  113273-06: SunOS 5.9: /usr/lib/ssh/sshd Patch

>... why is there inconsistent behaviour with ssh exit codes?  Why are
>there sporadic exit codes of 0 from the following ssh command?

It's a bug which is being addressed.

(There's a race condition between processes exiting and stdin/stdout
being closed, so sshd can close the connection before it has seen
the exit status)

Casper
-- 
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
0
Reply Casper 7/8/2004 8:16:44 PM


Casper H.S. Dik <Casper.Dik@Sun.COM> writes:

> Juergen Keil <jk@tools.de> writes:
>
>
>>On Solaris 9, with the latest ssh/sshd patches installed ...
>
>>  114356-03: SunOS 5.9: /usr/bin/ssh Patch
>>  113273-06: SunOS 5.9: /usr/lib/ssh/sshd Patch
>
>>... why is there inconsistent behaviour with ssh exit codes?  Why are
>>there sporadic exit codes of 0 from the following ssh command?
>
> It's a bug which is being addressed.
>
> (There's a race condition between processes exiting and stdin/stdout
> being closed, so sshd can close the connection before it has seen
> the exit status)

Is that the same bug that causes my CVS over ssh sessions to hang?

Dragan

-- 
Dragan Cvetkovic, 

To be or not to be is true. G. Boole      No it isn't.  L. E. J. Brouwer

!!! Sender/From address is bogus. Use reply-to one !!!
0
Reply Dragan 7/8/2004 8:19:03 PM

In article <wyoemqia9c.fsf@tools.de>, Juergen Keil wrote:

>On Solaris 9, with the latest ssh/sshd patches installed ...
>
>  114356-03: SunOS 5.9: /usr/bin/ssh Patch
>  113273-06: SunOS 5.9: /usr/lib/ssh/sshd Patch
>
>... why is there inconsistent behaviour with ssh exit codes?  Why are
>there sporadic exit codes of 0 from the following ssh command?
>
>% repeat 100 sh -c 'ssh -n localhost "exit 33" ; echo $?'
>33
>33
>33
>0
>33
>33
>33
>33
>33
>0
>0
>0
>0
>33
>33
>^Z
>Suspended

Obviously your "localhost" is round-robin DNS to hosts with different
definitions of "exit" !    Have you had a visit from my SAs ?

Is it more informative to do "uname ; exit 33" to let you see
whether the remote command got run ?

-- 
Elvis Notargiacomo  master AT barefaced DOT cheek
http://www.notatla.org.uk/goen/
0
Reply elvis 7/8/2004 8:27:25 PM

In article <lm7jte5k20.fsf@privacy.net>,
Dragan Cvetkovic  <dragan_usenet@gmx.net> wrote:

>>>On Solaris 9, with the latest ssh/sshd patches installed ...
>>
>>>  114356-03: SunOS 5.9: /usr/bin/ssh Patch
>>>  113273-06: SunOS 5.9: /usr/lib/ssh/sshd Patch
>>
>>>... why is there inconsistent behaviour with ssh exit codes?  Why are
>>>there sporadic exit codes of 0 from the following ssh command?
>>
>> It's a bug which is being addressed.
>>
>> (There's a race condition between processes exiting and stdin/stdout
>> being closed, so sshd can close the connection before it has seen
>> the exit status)
>
>Is that the same bug that causes my CVS over ssh sessions to hang?

It happens mostly on Linux clients.... Here is what I do for my Star
backup script:

        _cmd=` eval echo "$STAR -cM -time f=$RTAPE VOLHDR= $host:$i $STAR_ARGS $STAR_EXTRA -C $i . \; r=\$\? \; sleep 10 \; exit \$\r"`
        ssh -q "$host" -l root "$_cmd"
        excode=$?
        if [ $excode -ne 0 ]; then
                echo "----> EXICODE: $excode for $host:$i"
        fi

-- 
EMail:joerg@schily.isdn.cs.tu-berlin.de (home) J�rg Schilling D-13353 Berlin
      js@cs.tu-berlin.de		(uni)  If you don't have iso-8859-1
      schilling@fokus.fraunhofer.de	(work) chars I am J"org Schilling
URL:  http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.de/pub/schily
0
Reply js 7/8/2004 9:36:13 PM

4 Replies
450 Views

(page loaded in 0.056 seconds)

Similiar Articles:













7/21/2012 5:44:46 PM


Reply: