I assume, that gnupg should ship with some sort of gpg-agent loader, that may be disabled by default, but that should exist.
GPG User guide has separate section about auto-launching GPG agent on X-session start that will be never complete. Why? There are some non-trivial glitches about launching gpg-agent. For example, gpg-agent should be launched before dbus when XFCE is used as xfrun4 (xfce program launcher) starts programs using dbus API.
/etc/X11/xinit/xinitrc.d/20-gpg-agent looks like proper place for launching gpg-agent.
Bug #134984 may be relevant too.
Created attachment 181978 [details]
gpg-agent startup script
Created attachment 183784 [details]
gpg-agent startup script
Added check for existing $HOME/.gnupg directory.
*** Bug 279545 has been marked as a duplicate of this bug. ***
i've experienced the same troubles with non-starting gpg-agent.
But I see the .gpg-agent-info as $HOME/.gnupg/.gpg-agent-info (app-crypt/gnupg-2.0.11).
I'll commit an suggestion, referring to http://bugs.gentoo.org/attachment.cgi?id=199613 .
Created attachment 199615 [details]
/etc/X11/xinit/xinitrc.d/20-gpg-agent working with app-crypt/gnupg-2.0.11
works with gnome on amd64, can somebody test this, please?
> works with gnome on amd64, can somebody test this, please?
Works here on stable x86 with (unstable) gnome-light-2.26.3. Thanks.
Created attachment 205831 [details]
Updated script to work with gdm
Finally I found two problems with the script from comment #5.
I'm using gdm. Since the gpg-agent is launched with the eval command, it is not linked to gnome-session, and is not killed when logout. The process is still running alone, which bring us to the second problem : when I re-login, the old gpg-agent is still running, but the eval command was not executed, so the GPG_AGENT_INFO variable was not exported to the environment, resulting in the current gpg-agent process unusable.
The attached script fix these two issues. In my case (gnome-light, gdm), since gdm provide a script to launch the ssh-agent, I think that this one should also be provided by gdm.
GDM shouldn't provide ssh-agent script IMO so this script should belong to gnupg package. Those scripts are full usable outside of GDM without it even installed.
kde-base/kdebase-startkde provides /etc/kde/startup/agent-startup.sh :) .
1. please do NOT pass extra options like "--default-cache-ttl 300 --max-cache-ttl 999999". If we install them in the core system, they override the options in ~/.gnupg/gpg-agent.conf
2. The latest attachment doesn't seem to actually execute the agent here. Please test more on awesomeWM and fluxbox.
(In reply to comment #10)
> 2. The latest attachment doesn't seem to actually execute the agent here.
> Please test more on awesomeWM and fluxbox.
I noticed that fluxbox will only execute gpg-agent with this script if the Xsession is launched with startx from a console:
7201 tty2 Ss 0:00 /bin/login --
9140 tty2 S 0:00 \_ -bash
9322 tty2 S+ 0:00 \_ /bin/sh /usr/bin/startx
9338 tty2 S+ 0:00 \_ xinit /etc/X11/xinit/xinitrc -- /etc/X11/xinit/xserverrc :0 -auth /home/michael/.serverauth.9322
9339 tty7 Ss+ 0:04 \_ /usr/bin/X -nolisten tcp
9345 tty2 S 0:00 \_ /usr/bin/ck-launch-session /usr/bin/gpg-agent --sh --write-env-file /home/michael/.gnupg/.gpg-agent-info --daemon -- /etc/X11/Sessions/fluxbox
9423 tty2 S 0:00 \_ /usr/bin/fluxbox
9424 ? Ss 0:00 \_ /usr/bin/gpg-agent --sh --write-env-file /home/michael/.gnupg/.gpg-agent-info --daemon -- /etc/X11/Sessions/fluxbox
(This looks odd, is gpg-agent being executed twice?)
When I launch fluxbox from a login manager (xdm) then it seems that xinit is not used and therefore the gpg-agent is not executed. I'll check on a second machine tonight to see what that gives.
> When I launch fluxbox from a login manager (xdm) then it seems that xinit is
> not used and therefore the gpg-agent is not executed. I'll check on a second
> machine tonight to see what that gives.
I would consider that in particular to be a fluxbox bug. Its Xsession script needs to be updated to jive more cleanly with the new xinit.d scripts.
As a workaround, just set your XSESSION environment to be '/usr/src/startfluxbox' and all the xinit.d scripts should fire as expected.
I haven't seen any posts from the OP in more than a year. It's still broken on AwesomeWM (w/ xdm).
Please reopen w/ a fixed script. Also anybody that uses an alternative agent will want to NOT use this.