gpg module fix: already running#1732
Conversation
Fix gpg module grep regex expression, because of matching failed when `GPG_AGENT_INFO` is empty. And use gpgconf to get socket file instead of `$GNUPGHOME`. fix: sorin-ionescu#1681
such as pam ssh auth on NixOS.
|
Can you give me an example of tools that are broken? Isn't |
|
@belak On my system, prezto will print
|
|
Any progress on this PR? I seem to have the same issue when ssh-ing into a ubuntu server. |
|
I described the problem and potential solutions in #1164 |
|
@1wilkens gpgconf always returns the path whether gpg-agent starts or not. When not starting, it returns the path which agent creates by default. |
|
But in that case it would return |
|
@1wilkens IMO, the one who uses prezto to startup a gpg-agent, may not want to use systemd to start it again. If systemd has started gpg-agent, gpg module in prezto will check it, and won't start again. In the first scenario, gpgconf returns the default path which is used by prezto to create sockets. |
…t simple for checking
|
@belak Could this pr be merged? I edit the description and make it compatible on some system. Proposed Changes:
|
|
I found the fix on another users fork but I did not see a pull request for it and they have one syntax error. What's the protocol for this? I'm new to this kind of thing, but I would like to get the fix into the system. Edit: Never mind, it's already in this pull request. Guess it just never got merged into master |
|
@indrajitr or @belak can you folks take a look at this PR to see if it make sense, please? It would be nice to finally not have this message in every terminal 😃 |

Fixes #1681, #1164
Proposed Changes
gpgconfto get gpg-agent path instead of using environment variables and a fixed path by default, which is more compatible. For example: gpg has been started by systemd, and the sockets is set by sockets.target which is different from the default path ~/.gnugp/S.gpg-agent and no environment variable is set for current shell, but gpgconf can find the correct socket file and using it to check whether gpg-agent is already run. Otherwise, prezto will promptgpg-agent: a gpg-agent is already running - not starting a new oneat startup and it don't pick up the correct gpg-agent socket.This pr is the same as #1682 but switching into a new branch(not master).