gpg-agent dont start automatically
Jason Hellenthal
jhell at DataIX.net
Fri Jul 15 22:59:03 UTC 2011
On Thu, Jul 14, 2011 at 12:57:36AM -0700, Doug Barton wrote:
> On 07/13/2011 23:42, joerg_surmann wrote:
> >
> > Hi all,
> >
> > i have in my .xinitrc:
> > exec /usr/local/bin/gpg-agent --daemon --write-env-file
> > .gnupg/agent.info /usr/home/holm/.gpg-agent-info
> >
> > Thats don't start gpg-agent.
>
> Take a look at this:
>
> http://dougbarton.us/PGP/gpg-agent.html
>
This may be helpful too for reference there are a lot of ways you can go
about setting this up. Here is mine.
=======================================================================
using cron @reboot & every 5 minutes:
#!/bin/sh
# Start gpg-agent if it is not running as the current user.
umask 077
rm -f $HOME/.gpg-agent-info # only for @reboot. remove for minutely
pgrep -q -U $LOGNAME gpg-agent ||/usr/local/bin/gpg-agent --daemon
--write-env-file "${HOME}/.gpg-agent-info" >>/dev/null 2>&1
========================================================================
Then in your profile or rc file for the shell: (bourne compatible)
GPG_TTY="$(tty)"
if [ -n "$(pgrep -U $LOGNAME gpg-agent)" -a -f ${HOME}/.gpg-agent-info ]; then
. ${HOME}/.gpg-agent-info
export GPG_AGENT_INFO
if [ -S ${HOME}/.gnupg/S.gpg-agent.ssh ]; then
export SSH_AUTH_SOCK
fi
echo "GNU Privacy Guard Agent [ENABLED]"
echo
else
unset GPG_AGENT_INFO
if [ -f ${HOME}/.gpg-agent-info ]; then
rm -f ${HOME}/.gpg-agent-info
fi
fi
========================================================================
Adjust appropriately for your environment.
This should allow you to use gpg-agent form the console, any xterm, rxvt
etc... and any X applications while X is running and ensure that
gpg-agent is restarted if it for some reason fails.
Good luck.
More information about the freebsd-stable
mailing list