-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GPG module output agent already running on NixOS #1681
Comments
Vonfry
added a commit
to Vonfry/prezto
that referenced
this issue
Jan 26, 2019
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
This also affects Debian testing in the same way. |
I think this is a duplicate of #1164 and I proposed potential solutions there. |
Closing as duplicate of #1164 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
On NixOS, gpg don't export
GPG_AGENT_INFO
variable andS.gpg-agent
file is under/run/user/<uid>/gnupg/S.gpg-agent
, not~/.gnupg/
.grep cannot match correctly.
prezto-repo about gpg init
Because of first point, the second if-condition about grep, cannot match gpg-agent process, but the process exists.
Output
echo ${${${(s.:.)GPG_AGENT_INFO}[2]}:--1} gpg-agent
:-1 gpg-agent
Output
ps -U "$LOGNAME" -o pid,ucomm | grep " gpg-agent
:29385 gpg-agent
One way to solve is to use
gpgconf
command I think.By the way, possibly, there are other system having the same problem. I think we can find another way to decide whether gpg-agent is run or not, or try to fix the second grep regex expression to let it fix all system.
Expected behavior
Output:
gpg-agent: a gpg-agent is already running - not starting a new one
Actual behavior
No output if it is started.
Steps to Reproduce
NixOS only. Reproduce may be done by installing gpg with
nix
.Versions
The text was updated successfully, but these errors were encountered: