Restarting gpg-agent

Werner Koch wk at
Mon Mar 15 17:54:49 CET 2010

On Mon, 15 Mar 2010 11:58, roam at said:

>>     # start gpg-agent if no running instance is found
>>     if test -z "${GPG_AGENT_INFO}" ||
>>        ! kill -0 `grep GPG_AGENT_INFO ${GA_INFO_FILE} | cut -d: -f 2 -` 2>/dev/null; then
> In this way, you risk a false positive if gpg-agent has died (or not
> been started at all, but a file has been left over)

I have not follewed this thread.  However the code above is far too
complex.  For years gpg-agent is able to test whether it is already
running, just call gpg-agent and don't pass the --daemon option:

  $ gpg-agent
  gpg-agent: gpg-agent running and available
  $ echo $?
  $ GPG_AGENT_INFO= gpg-agent
  gpg-agent: no gpg-agent running in this session
  $ echo $?



Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.

More information about the Gnupg-users mailing list