Reliably determining that the agent is available and starting it if not

Doug Barton dougb at
Fri Feb 22 07:49:48 CET 2013

On 02/21/2013 06:32 PM, Craig Ringer wrote:
> On 02/22/2013 09:18 AM, Doug Barton wrote:
>> I have the following script that does this for you in a Unix'y
>> environment, assuming your DE doesn't already handle it:
> What I'm hoping for is something I can use in a utility script, so that
> the user doesn't have to mess with their (likely distro-specific) login
> session setup details.

That's a good thought, but the problem is that they are very different. 
Unless you have a limited number of relevant DEs, and/or you're willing 
to do a lot of research to cover all/most of them, you're in for a rough 

> If they already have an agent, I want to use it,
> and if they don't I want to start one for the ues of the script.

The script I sent you the link to has the ability to determine if the 
agent is running.

> If I need to I can take the approach you have there, where you set the
> agent up globally across the user session, and just make people perform
> the setup steps if their DE doesn't already provide an agent. I was just
> hoping for something a bit more transparent.

You could also use the "standard socket" approach instead. Check out the 
man page for gpg-agent.



More information about the Gnupg-users mailing list