Mailing List Archive

Continuing 2.3 weirdness
Turns out the problem was keyboxd was waiting for a lock. Unfortunately
I wasn't able to find the lock: so, after making a backup, I decided to
resort to harsh measures: I nuked my .gnupg directory. Now GnuPG is
getting a little further along, but it's still not working properly.

Let's start by nuking the .gnupg directory and shutting down all GnuPG
daemons:

rjh@ripley:~$ rm -rf .gnupg
rjh@ripley:~$ /usr/local/bin/gpgconf --kill all
rjh@ripley:~$ ps ax|grep [g]pg-agent

No output: gpg-agent is gone, and I'm assuming other GnuPG daemons are,
too. Next, verify we have a /usr/local/bin/gpg-agent and that it points
to the correct GnuPG helper programs:

rjh@ripley:~$ ls -lh /usr/local/bin/gpg-agent
-rwxr-xr-x 1 root root 2.3M Dec 5 20:19 /usr/local/bin/gpg-agent
rjh@ripley:~$ /usr/local/bin/gpgconf --check-programs
gpg:OpenPGP:/usr/local/bin/gpg:1:1:
gpgsm:S/MIME:/usr/local/bin/gpgsm:1:1:
keyboxd:Public Keys:/usr/local/libexec/keyboxd:1:1:
gpg-agent:Private Keys:/usr/local/bin/gpg-agent:1:1:
scdaemon:Smartcards:/usr/local/libexec/scdaemon:1:1:
dirmngr:Network:/usr/local/bin/dirmngr:1:1:
pinentry:Passphrase Entry:/usr/local/bin/pinentry:1:1:

All looks good. Let's launch gpg-agent.

rjh@ripley:~$ /usr/local/bin/gpgconf --launch gpg-agent
rjh@ripley:~$ ps ax|grep [g]pg-agent
229366 ? SLs 0:00 /usr/bin/gpg-agent --supervised

Wait, what? Why was /usr/bin/gpg-agent (system-provided, version 2.2)
used instead of 2.3?

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: Continuing 2.3 weirdness [ In reply to ]
On Mittwoch, 8. Dezember 2021 04:49:12 CET Robert J. Hansen via Gnupg-users
wrote:
> Let's start by nuking the .gnupg directory and shutting down all GnuPG
> daemons:
>
> rjh@ripley:~$ rm -rf .gnupg
> rjh@ripley:~$ /usr/local/bin/gpgconf --kill all
> rjh@ripley:~$ ps ax|grep [g]pg-agent
>
> rjh@ripley:~$ /usr/local/bin/gpgconf --launch gpg-agent
> rjh@ripley:~$ ps ax|grep [g]pg-agent
> 229366 ? SLs 0:00 /usr/bin/gpg-agent --supervised
>
> Wait, what? Why was /usr/bin/gpg-agent (system-provided, version 2.2)
> used instead of 2.3?

I make different observations (using self-compiled gpg installed to /opt/
gnupg/master with a non-standard GNUPGHOME):
$ echo $PATH | grep /opt/gnupg/master
-> no output
$ GNUPGHOME=$(mktemp -d --tmpdir gnupg.XXXXXXXXXX) \
/opt/gnupg/master/bin/gpgconf --launch gpg-agent
-> use a new temporary GNUPGHOME
$ ps ax | grep [g]pg-agent
7337 ? Ss 0:00 gpg-agent --homedir /tmp/gnupg.hq2lhQi4eF --use-
standard-socket --daemon
$ ls -l /proc/7337/exe
lrwxrwxrwx 1 ingo users 0 Dez 8 09:13 /proc/7337/exe -> /opt/gnupg/master/
bin/gpg-agent*

Observations:
* Here gpgconf launches the correct gpg-agent.
* Here gpgconf is launched with different command line arguments.

Do you probably have a global gnupg configuration file in /etc?

$ /opt/gnupg/master/bin/gpgconf --list-config
-> no output -> no global configuration file

Or use the brand new (post-2.3.3) --show-configs option which lists all
configuration files with all options:
$ GNUPGHOME=/tmp/gnupg.hq2lhQi4eF /opt/gnupg/master/bin/gpgconf --show-configs
### Dump of all standard config files
### GnuPG 2.3.4-beta24 (b124bca59)
### GNU/Linux
### Libgcrypt 1.9.4-unknown
### GpgRT 1.43
###

sysconfdir:/etc/gnupg
bindir:/opt/gnupg/master/bin
libexecdir:/opt/gnupg/master/libexec
libdir:/opt/gnupg/master/lib64/gnupg
datadir:/opt/gnupg/master/share/gnupg
localedir:/opt/gnupg/master/share/locale
socketdir:/run/user/1000/gnupg/d.61urptbn5qmwuf71byjbhrh8
dirmngr-socket:/run/user/1000/gnupg/d.61urptbn5qmwuf71byjbhrh8/S.dirmngr
keyboxd-socket:/run/user/1000/gnupg/d.61urptbn5qmwuf71byjbhrh8/S.keyboxd
agent-ssh-socket:/run/user/1000/gnupg/d.61urptbn5qmwuf71byjbhrh8/S.gpg-
agent.ssh
agent-extra-socket:/run/user/1000/gnupg/d.61urptbn5qmwuf71byjbhrh8/S.gpg-
agent.extra
agent-browser-socket:/run/user/1000/gnupg/d.61urptbn5qmwuf71byjbhrh8/S.gpg-
agent.browser
agent-socket:/run/user/1000/gnupg/d.61urptbn5qmwuf71byjbhrh8/S.gpg-agent
homedir:/tmp/gnupg.hq2lhQi4eF

###
### global config "/etc/gnupg/common.conf": not installed
###
###
### local config "/tmp/gnupg.hq2lhQi4eF/common.conf": not installed
###

###
### global config "/etc/gnupg/gpg-agent.conf": not installed
###
###
### local config "/tmp/gnupg.hq2lhQi4eF/gpg-agent.conf": not installed
###

###
### global config "/etc/gnupg/scdaemon.conf": not installed
###
###
### local config "/tmp/gnupg.hq2lhQi4eF/scdaemon.conf": not installed
###

###
### global config "/etc/gnupg/dirmngr.conf": not installed
###
###
### local config "/tmp/gnupg.hq2lhQi4eF/dirmngr.conf": not installed
###

###
### global config "/etc/gnupg/gpg.conf": not installed
###
###
### local config "/tmp/gnupg.hq2lhQi4eF/gpg.conf": not installed
###

###
### global config "/etc/gnupg/gpgsm.conf": not installed
###
###
### local config "/tmp/gnupg.hq2lhQi4eF/gpgsm.conf": not installed
###

Regards,
Ingo
Re: Continuing 2.3 weirdness [ In reply to ]
> I make different observations (using self-compiled gpg installed to /opt/
> gnupg/master with a non-standard GNUPGHOME):

It turns out the source of the trouble was systemd, which was starting
gpg-agent on demand, and was forcing it to use /usr/bin/gpg-agent.
Setting a user override file fixed the behavior.

Really annoying to hunt down, though. My thanks to Phil Pennock for
helping me debug this.

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users