From 01cfa52e95157cb006314df62fe9cbc8d778af5f Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sat, 4 Apr 2020 17:06:32 +0200 Subject: [PATCH] systemd: start ssh-agent from systemd --- systemd/awesome@.service | 1 + systemd/graphical-session@.target | 1 + systemd/ssh-agent.service | 8 ++++++++ 3 files changed, 10 insertions(+) create mode 100644 systemd/ssh-agent.service diff --git a/systemd/awesome@.service b/systemd/awesome@.service index 186299f..cd5363b 100644 --- a/systemd/awesome@.service +++ b/systemd/awesome@.service @@ -5,6 +5,7 @@ After=autorandr@%i.service After=compton@%i.service After=xsettingsd@%i.service After=tmux.service +After=ssh-agent.service Before=nm-applet@%i.service Before=wallpaper@%i.service diff --git a/systemd/graphical-session@.target b/systemd/graphical-session@.target index 31a2f11..d1338fa 100644 --- a/systemd/graphical-session@.target +++ b/systemd/graphical-session@.target @@ -14,3 +14,4 @@ Wants=xiccd@%i.service Wants=xsettingsd@%i.service Wants=xss-lock@%i.service Wants=tmux.service +Wants=ssh-agent.socket diff --git a/systemd/ssh-agent.service b/systemd/ssh-agent.service new file mode 100644 index 0000000..83c669f --- /dev/null +++ b/systemd/ssh-agent.service @@ -0,0 +1,8 @@ +[Unit] +Description=SSH key agent + +[Service] +Type=simple +Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket +ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK +ExecStart=/usr/bin/dbus-update-activation-environment SSH_AUTH_SOCK=$SSH_AUTH_SOCK