Hi,

Eelco Dolstra <[email protected]> skribis:

> On 09/12/11 11:21, Ludovic Courtès wrote:
>
>> (The behavior of lshd seems OK to me since the subshell gets a copy of
>> the parent shell’s stdin, so closing one shouldn’t close the other.)
>
> I don't think so.  It's not about closing but getting an EOF.  I would expect
> lshd to close the write side of the shell's stdin, so that any child process
> that attempts to read from it gets EOF.

Yes, but the subshell gets a /duplicate/ of the shell’s stdin.

>> -if (system("exec ssh $hostName @sshOpts '(read; kill -INT -\$\$) <&0 & 
>> nix-store -r $drvPath $buildFlags > /dev/null' 2>&4") != 0) {
>> +if (system("exec ssh $hostName @sshOpts 'trap \"kill -INT -\$\$\" SIGPIPE ; 
>> nix-store -r $drvPath $buildFlags > /dev/null' 2>&4") != 0) {
>
> Does this actually work?

It works in the common case (no SIGPIPE).

> A process only gets a SIGPIPE if it does a write(), right?

Right, good point.

Hmm I’m not even sure why these things need to be done.  Suppose your
run “ssh host foo”; when the SSH daemon loses the connection, doesn’t it
kill ‘foo’ automatically?

Thanks,
Ludo’.
_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to