| 1 |
Socket-activated dirmngr and gpg-agent with systemd |
| 2 |
=================================================== |
| 3 |
|
| 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 |
| 8 |
socket-activation. |
| 9 |
|
| 10 |
System distributors |
| 11 |
------------------- |
| 12 |
|
| 13 |
The *.service and *.socket files (from this directory) should be |
| 14 |
placed in /usr/lib/systemd/user/ alongside other user-session services |
| 15 |
and sockets. |
| 16 |
|
| 17 |
To enable socket-activated dirmngr for all accounts on the system, |
| 18 |
use: |
| 19 |
|
| 20 |
systemctl --user --global enable dirmngr.socket |
| 21 |
|
| 22 |
To enable socket-activated gpg-agent for all accounts on the system, |
| 23 |
use: |
| 24 |
|
| 25 |
systemctl --user --global enable gpg-agent.socket |
| 26 |
|
| 27 |
Additionally, you can enable socket-activated gpg-agent ssh-agent |
| 28 |
emulation for all accounts on the system with: |
| 29 |
|
| 30 |
systemctl --user --global enable gpg-agent-ssh.socket |
| 31 |
|
| 32 |
You can also enable restricted ("--extra-socket"-style) gpg-agent |
| 33 |
sockets for all accounts on the system with: |
| 34 |
|
| 35 |
systemctl --user --global enable gpg-agent-extra.socket |
| 36 |
|
| 37 |
Individual users |
| 38 |
---------------- |
| 39 |
|
| 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 |
| 42 |
them available. |
| 43 |
|
| 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 |
| 47 |
all future sessions: |
| 48 |
|
| 49 |
systemctl --user enable dirmngr.socket |
| 50 |
|
| 51 |
To enable socket-activated gpg-agent with ssh support, do: |
| 52 |
|
| 53 |
systemctl --user enable gpg-agent.socket gpg-agent-ssh.socket |
| 54 |
|
| 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 |
| 57 |
logging out). |
| 58 |
|
| 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: |
| 64 |
|
| 65 |
gpgconf --kill dirmngr |
| 66 |
systemctl --user start dirmngr.socket |