openssh-agent polling

Peter Stuge stuge-openssh-unix-dev at cdy.org
Fri Sep 14 21:57:24 EST 2007


On Thu, Sep 13, 2007 at 10:50:57PM +1000, Darren Tucker wrote:
> Peter Stuge wrote:
> > On Thu, Sep 13, 2007 at 04:00:22PM +1000, David Leonard wrote:
> >> There is a 10 second parent polling behaviour which is probably
> >> what powertop is seeing.. select is using a timeout being the
> >> minimum of the poll time (10sec) or the next time a key expires.
> > 
> > What if you remove the timeout?
> 
> The agent will hang around forever after the process it's serving
> has gone away, unless a key happens to expire.

I see. The only solution to this that I can come up with is another
process who waitpid()s on the parent, and a pipe() or signal back to
the main ssh-agent so that it can select() without a timeout.

A small improvement over the current state would be that ssh-agent
then exits as soon as the parent exits, rather than after an
arbitrary timeout - at the cost of a new process.


//Peter


More information about the openssh-unix-dev mailing list