File: gpg-agent-ssh.socket

package info (click to toggle)
gnupg2 2.4.8-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 49,004 kB
  • sloc: ansic: 287,593; sh: 7,938; lisp: 6,735; makefile: 1,982; awk: 160; xml: 53; sed: 16; python: 16; php: 14; perl: 13
file content (22 lines) | stat: -rw-r--r-- 976 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[Unit]
Description=GnuPG cryptographic agent (ssh-agent emulation)
Documentation=man:gpg-agent(1) man:ssh-add(1) man:ssh-agent(1) man:ssh(1)

[Socket]
# If you change ListenStream, change the name in ExecStartPost below as well.
ListenStream=%t/gnupg/S.gpg-agent.ssh

# After creating and binding the service notify environment
# Don't get location from config file because systemd directly passes fd, overriding the config file
ExecStartPost=sh -c '[ -z "$$(gpgconf --list-options gpg-agent | awk -F: \'/^enable-ssh-support:/{print$$10}\')" ] || systemctl --user set-environment "$$@"' - "SSH_AUTH_SOCK=%t/gnupg/S.gpg-agent.ssh"

# before unbinding stop exporting that we listen to socket
ExecStopPre=sh -c '[ -z "$$(gpgconf --list-options gpg-agent | awk -F: \'/^enable-ssh-support:/{print$$10}\')" ] || systemctl --user unset-environment SSH_AUTH_SOCK'

FileDescriptorName=ssh
Service=gpg-agent.service
SocketMode=0600
DirectoryMode=0700

[Install]
WantedBy=sockets.target