nixos/gnupg: add systemd configuration#231108
Conversation
I'm not sure this is something we should be worried about, but without this change gpg-agent doesn't start under systemd, and doesn't have pinentry set. |
|
Yes, there is a race and I think the solution is for gnupg to just stop trying to manage the agent itself and let systemd (or any init system, for that matter) do its job. Unfortunately upstream went the other way. This PR is a reasonable solution, however they officially dropped systemd and already hinted that |
|
That sounds reasonable. I'll set it up that way instead...
…On 10 May 2023 16:52:12 GMT-03:00, Michele Guerini Rocco ***@***.***> wrote:
Yes, there is a race and I think the solution is for gnupg to just stop trying to manage the agent itself and let systemd (or any init system, for that matter) do its job. Unfortunately upstream went the other way.
This PR is a reasonable solution, however they officially dropped systemd and already hinted that `--pinentry-program` should not be used and may be removed. So, I would save ourselves some future troubles by configuring `pinentry-program` with /etc/gnupg.conf and let gnupg start the agent.
--
Reply to this email directly or view it on GitHub:
#231108 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
|
I added a commit to fix the existing reference to I also got it passing tests without systemd, but I'm worried the lack of socket activation will cause regressions. For example, SSH_AUTH_SOCK should allow ssh to start gpg-agent with socket activation, but I'm not sure if this actually works in practice. The test mentions: |
|
I think my recommendation would be to get this change in while we consider the consequences of dropping the systemd units. Then it'll be in the history in case people want to revert to it in the future, and we may even want to support both methods. |
rnhmjoj
left a comment
There was a problem hiding this comment.
As I already said, I'm ok with keeping the unit files provided pinentry-program is set from /etc/gnupg/gpg.conf, not the command line because that is too brittle.
|
@rnhmjoj sorry, I misunderstood. I'll make that change. |
|
Updated with:
The later is needed for gnupg < 2.4.1, and it's been reverted to 2.4.0 in master. Perhaps this should go in staging? |
|
Looks good. You can probably remove this line: as we don't rely on (potential, at this point) upstream units anymore. |
This depended on the systemd user configuration provided upstream in doc/examples. However, this was all removed in: gpg/gnupg@eae28f1
rnhmjoj
left a comment
There was a problem hiding this comment.
I checked the definitions against the previously supplied units and it seems ok.
The test is passing, so let's not delay the update any longer and merge this now.
|
I updated #231110 to include merging this into staging, and reverting the 2.4.1 rollback. I'm not sure if that's the right approach to take, but if so, it's there. |
This depended on the systemd user configuration provided upstream in doc/examples. However, this was all removed in:
gpg/gnupg@eae28f1
Description of changes
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)