Skip to content
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

Closed
Vonfry opened this issue Jan 25, 2019 · 4 comments · May be fixed by #1732
Closed

GPG module output agent already running on NixOS #1681

Vonfry opened this issue Jan 25, 2019 · 4 comments · May be fixed by #1732

Comments

@Vonfry
Copy link

Vonfry commented Jan 25, 2019

Description

  1. On NixOS, gpg don't export GPG_AGENT_INFO variable and S.gpg-agent file is under /run/user/<uid>/gnupg/S.gpg-agent, not ~/.gnupg/.

  2. 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

  • Prezto commit:master
  • OS information: NixOS 18.09
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
@Matir
Copy link

Matir commented Oct 3, 2019

This also affects Debian testing in the same way.

@andrei-pavel
Copy link

image

This fixes it on Arch.

@1wilkens
Copy link

1wilkens commented May 5, 2020

I think this is a duplicate of #1164 and I proposed potential solutions there.

@srijanshetty
Copy link
Collaborator

Closing as duplicate of #1164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants