Skip to content

GPG module output agent already running on NixOS  #1681

@Vonfry

Description

@Vonfry

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions