gpg-agent timer tick

Werner Koch wk at gnupg.org
Fri Jan 11 19:14:46 CET 2008


On Fri, 11 Jan 2008 18:09, alan-jenkins at tuffmail.co.uk said:

> This is potentially a Bad Thing for CPU power consumption, because it
> reduces the amount of time the CPU can spend in deep sleep states.  I

I thought that 2 seconds are long enough but tehre is no reason why we
can't have a config option for this. 

> my patch.  Let me know if you're interested here and I'll submit a

FSF copyright assignment is required, so it might be easier if we do it.

> In that case it runs the command given.  The tick handler is used to
> check, every two seconds, whether the command is still running; if
> not, gpg-agent quits.

10 seconds or even longer should not pose a problem.

> A better way to do this is to run the command as a child of gpg-agent,
> and rely on the SIGCHLD signal instead of a timer tick.

The problem with this approach is that any bug in gpg-agent causes the
entire child hierarchy to die.  Yes there should be no bug in gpg-agent
but in some cases (e.g. resource problems) it just prefers to exit.  It
is really annoying to see your desktop vanishing along with all the
unsaved data.

> The timer tick is also used to check the Scdaemon (whatever that is
> :-)
> is still running.  However, since it use waitpid() to check this,
> Scdaemon must already be being run a child, so that shouldn't be a

Scdaemon handles smartcards.

We could indeed change this to use SIGCHLD but given that we need a
ticker anyway I don't think that makes much sense.  Note that a future
version will use the ticker to do housekeeping for the saved
passphrases.

Would a option to set the timer tick help you?



Salam-Shalom,

   Werner

-- 
Die Gedanken sind frei.  Auschnahme regelt ein Bundeschgesetz.




More information about the Gnupg-devel mailing list