Capturing backgrounded dbclient command output

Steve Hein ssh at sgi.com
Sun Aug 1 04:25:24 WST 2010


I can confirm now that I am seeing the issue described
in this thread:

http://www.mail-archive.com/[email protected]/msg00325.html

and that it was a change in v0.49 that caused this behavior
change.     I tried to pour through the diffs from 0.48.1 to 0.49,
but it's big.......

Is there anything relatively easy that I can do to get back to the
0.48.1 behavior related to operating without stdin?    I really don't
want to fall back that far, but I really have a need for the
parallel ssh functionality I described originally, which needs the
ability to execute dbclient in the background (and get the command
output!).

Any help/hints would really be appreciated!

Steve


On 07/31/2010 09:01 AM, Steve Hein wrote:
> I've continued to investigate this issue, and the problem
> is specific to not having stdin available.   I found that
> I don't see my output when I run this:
>
> /tmp/dropbear-0.52/dbclient -y -i /tmp/id_rsa_db localhost pwd </dev/null
>
> or when I do this:
>
> /tmp/dropbear-0.52/dbclient -f -y -i /tmp/id_rsa_db localhost pwd
>
>
> But openssh handles lack of stdin just fine, i.e.:
>
> ssh localhost pwd < /dev/null
>
> will still return the command output.
>
>
>
> Is this dropbear behavior intentional?    If so, does anyone know
> what I would need to change to fix it?
>
> Thanks!
> Steve
>
>
>
>
>
>
> On 07/30/2010 02:10 PM, Steven Hein wrote:
>   
>> I've been using dropbear-0.52 happily for a long time now, but
>> today I tried to write a shell script to execute multiple
>> dbclient commands in parallel (backgrounded), capture
>> their output, and then display it when all dbclient
>> commands have finished.    But I can't seem to capture
>> any output from the dbclient command.
>>
>> The target platform for this is an embedded platform
>> running busybox....but I boiled it down to a simple
>> failing case on my Fedora 12 box    (I built a brand
>> new dbclient from the 0.52 tarball).
>>
>>
>> Here's the simple failing case:
>>
>>
>> #! /bin/sh
>>
>> (/tmp/dropbear-0.52/dbclient -y -i /tmp/id_rsa_db localhost pwd) >
>> /tmp/tout &
>> wait
>>
>>
>> When this script completes, there is nothing in /tmp/tout
>>
>>
>>
>> When I run this script (same case, just using the openssh client
>> instead):
>>
>> #! /bin/sh
>>
>> (ssh localhost pwd) > /tmp/tout &
>> wait
>>
>>
>> Then I have data in /tmp/out   (the output from the 'pwd' command).
>>
>>
>>
>>
>> This problem only appears to happen when the dbclient command is run
>> in the background from within a script.   If I run this command
>> directly from the shell command prompt:
>>
>> (/tmp/dropbear-0.52/dbclient -y -i /tmp/id_rsa_db localhost pwd) >
>> /tmp/tout &; wait
>>
>> Then /tmp/tout contains the output of the 'pwd' command.
>>
>>
>>
>> Has anyone else wrestled with this problem?    Any solutions or pointers?
>>
>>
>> Thanks!
>> Steve
>>
>>
>>     
>   



More information about the Dropbear mailing list