Page MenuHome GnuPG

gpgconf failed to kill all gpgagent daemons on windows
Open, Needs TriagePublic

Description

As the title mentioned, I try to kill all processes made by gnupg using gpgconf.exe (--kill all).

I am using the command "gpgconf.exe".

And as you can see, these daemons called "Gnupg's private key daemon" are actually gpg-agent.exe.
Is there something wrong wth gpgconf? Or I am not referring to the proper way to get things done.

Details

Version
2.4.5

Event Timeline

werner added a subscriber: werner.

gpgconf assumes that there is only one of the daemons. In fact it can only work with one and that is the one daemon which listens on the socket. all daemon's do a self-check by trying to connect to themself and terminate if they realize that they are not anymore the owner of the socket. As long as a daemon is started by a gnupg component a file system lock is taken to avoid duplicate launching. However it a daemon is stared by other means this could lead to a race.

Can you replicate the case or is this a one-off?

This issue occurs when using GPGME with multiple contexts and setting the OpenPGP engines to different GnuPG home paths. As you mentioned, it is crucial to let gpgconf know the correct home path so that it can locate the socket file used by gpg-agent and properly clean up all instances.

Additionally, I found that using Git Bash on Windows does not allow gpgconf to function correctly. Instead, I am now using PowerShell with the gpgconf --homedir option, which resolves the issue, and the cleanup function works as expected.