1 Socket-activated dirmngr and gpg-agent with systemd
2 ===================================================
4 When used on a GNU/Linux system supervised by systemd, you can ensure
5 that the GnuPG daemons dirmngr and gpg-agent are launched
6 automatically the first time they're needed, and shut down cleanly at
7 session logout. This is done by enabling user services via
13 The *.service and *.socket files (from this directory) should be
14 placed in /usr/lib/systemd/user/ alongside other user-session services
17 To enable socket-activated dirmngr for all accounts on the system,
20 systemctl --user --global enable dirmngr.socket
22 To enable socket-activated gpg-agent for all accounts on the system,
25 systemctl --user --global enable gpg-agent.socket
27 Additionally, you can enable socket-activated gpg-agent ssh-agent
28 emulation for all accounts on the system with:
30 systemctl --user --global enable gpg-agent-ssh.socket
32 You can also enable restricted ("--extra-socket"-style) gpg-agent
33 sockets for all accounts on the system with:
35 systemctl --user --global enable gpg-agent-extra.socket
40 A user on a system with systemd where this has not been installed
41 system-wide can place these files in ~/.config/systemd/user/ to make
44 If a given service isn't installed system-wide, or if it's installed
45 system-wide but not globally enabled, individual users will still need
46 to enable them. For example, to enable socket-activated dirmngr for
49 systemctl --user enable dirmngr.socket
51 To enable socket-activated gpg-agent with ssh support, do:
53 systemctl --user enable gpg-agent.socket gpg-agent-ssh.socket
55 These changes won't take effect until your next login after you've
56 fully logged out (be sure to terminate any running daemons before
59 If you'd rather try a socket-activated GnuPG daemon in an
60 already-running session without logging out (with or without enabling
61 it for all future sessions), kill any existing daemon and start the
62 user socket directly. For example, to set up socket-activated dirmgnr
63 in the current session:
65 gpgconf --kill dirmngr
66 systemctl --user start dirmngr.socket