summaryrefslogtreecommitdiff
path: root/debian/ssh-agent.user-session.upstart
diff options
context:
space:
mode:
Diffstat (limited to 'debian/ssh-agent.user-session.upstart')
-rw-r--r--debian/ssh-agent.user-session.upstart20
1 files changed, 2 insertions, 18 deletions
diff --git a/debian/ssh-agent.user-session.upstart b/debian/ssh-agent.user-session.upstart
index 385a9ecc6..672d2a0de 100644
--- a/debian/ssh-agent.user-session.upstart
+++ b/debian/ssh-agent.user-session.upstart
@@ -3,21 +3,5 @@ author "Stéphane Graber <stgraber@ubuntu.com>"
3 3
4start on starting xsession-init 4start on starting xsession-init
5 5
6pre-start script 6exec /usr/lib/openssh/agent-launch start
7 [ -e /etc/X11/Xsession.options ] || { stop; exit 0; } 7post-stop exec /usr/lib/openssh/agent-launch stop
8 grep -q "^use-ssh-agent$" /etc/X11/Xsession.options || { stop; exit 0; }
9 [ -z "$SSH_AUTH_SOCK" ] || { stop; exit 0; }
10
11 eval "$(ssh-agent -s)" >/dev/null
12 initctl set-env --global SSH_AUTH_SOCK=$SSH_AUTH_SOCK
13 initctl set-env --global SSH_AGENT_PID=$SSH_AGENT_PID
14 initctl set-env --global SSH_AGENT_LAUNCHER=upstart
15end script
16
17post-stop script
18 [ "$SSH_AGENT_LAUNCHER" = upstart ] || exit 0
19 kill $SSH_AGENT_PID 2>/dev/null || true
20 initctl unset-env --global SSH_AUTH_SOCK
21 initctl unset-env --global SSH_AGENT_PID
22 initctl unset-env --global SSH_AGENT_LAUNCHER
23end script