Restarting gnupg-agent inside X session

David Tomaschik david at systemoverlord.com
Tue Mar 1 00:49:24 CET 2011


On 02/28/2011 06:17 PM, Marco Steinacher wrote:
> Hi,
> 
> I use a OpenPGP smartcard with gnupg 2.0.14 and Ubuntu for different
> tasks. From time to time I face the following problem: The gpg-agent
> crashes for some reason after entering the PIN, 'ps' reports the daemon
> process as a zombie
> 
> STAT START   TIME COMMAND
> Zs   Feb26   0:01 [gpg-agent] <defunct>
> 
> and 'gpgconf --reload scdaemon' gives the following error:
> 
> gpgconf: error running `/usr/bin/gpg-connect-agent': exit status 1
> gpgconf: error running `/usr/bin/gpg-connect-agent scd killscd': General
> error
> 
> One problem is the fact that the agent crashes but I'm more after a
> solution how to recover after it crashed for any reason. I can restart
> the gpg-agent inside a terminal but then it is not available for
> applications such as Thunderbird with Enigmail. So far, the only
> solution that I know of is restarting the X session, i.e. log out and
> log in again. But to do this I have to close all running applications
> which sometimes is not an option.
> 
> Therefore I wonder if anybody knows of a solution to restart gpg-agent
> on the level of the gnome-session without restarting the session itself.
> Perhaps one way would be to somehow change the GPG_AGENT_INFO
> environment variable for the running session, but I don't know if that's
> possible. Any ideas?
> 
> Many thanks,
> Marco

Each process has its own copy of the environment inherited from its
parent, so it's not possible to change the GPG_AGENT_INFO variable for
all processes.  You could start gpg-agent with --use-standard-socket,
and programs should fall back to that.

       --use-standard-socket
       --no-use-standard-socket
      By enabling this option gpg-agent  will  listen  on  the 	socket
      named ‘S.gpg-agent’, located in the home directory, and not cre‐
      ate a random socket below a temporary directory.  Tools connect‐
      ing to gpg-agent should first try to connect to the socket given
      in environment variable GPG_AGENT_INFO and  then  fall  back  to
      this  socket.  This option may not be used if the home directory
      is mounted as a remote file system.  Note, that  --use-standard-
      socket is the default on Windows systems.

David



More information about the Gnupg-users mailing list