diff options
author | Stéphane Graber <stgraber@ubuntu.com> | 2013-03-25 16:55:41 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2013-03-25 16:55:41 +0000 |
commit | 0062ebe7b4e524952eb2fb79e38d8bc3f3b213ef (patch) | |
tree | a73fef54f767e25d77b5d90678279e401d73152d /debian | |
parent | fb0148c9ba78689cd03c9cf2ee05a4fa22a0ed69 (diff) |
Add ssh-agent upstart user job. This implements something similar to
the 90x11-common_ssh-agent Xsession script. That is, start ssh-agent
and set the appropriate environment variables (closes: #703906).
Diffstat (limited to 'debian')
-rw-r--r-- | debian/changelog | 5 | ||||
-rwxr-xr-x | debian/rules | 3 | ||||
-rw-r--r-- | debian/ssh-agent.user-session.upstart | 19 |
3 files changed, 27 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index 78c582918..13b39f04e 100644 --- a/debian/changelog +++ b/debian/changelog | |||
@@ -5,6 +5,11 @@ openssh (1:6.1p1-4) UNRELEASED; urgency=low | |||
5 | should be read, and move the pam_env calls from "auth" to "session" so | 5 | should be read, and move the pam_env calls from "auth" to "session" so |
6 | that it's also read when $HOME is encrypted (LP: #952185). | 6 | that it's also read when $HOME is encrypted (LP: #952185). |
7 | 7 | ||
8 | [ Stéphane Graber ] | ||
9 | * Add ssh-agent upstart user job. This implements something similar to | ||
10 | the 90x11-common_ssh-agent Xsession script. That is, start ssh-agent | ||
11 | and set the appropriate environment variables (closes: #703906). | ||
12 | |||
8 | -- Colin Watson <cjwatson@debian.org> Thu, 14 Feb 2013 09:33:00 +0100 | 13 | -- Colin Watson <cjwatson@debian.org> Thu, 14 Feb 2013 09:33:00 +0100 |
9 | 14 | ||
10 | openssh (1:6.1p1-3) experimental; urgency=low | 15 | openssh (1:6.1p1-3) experimental; urgency=low |
diff --git a/debian/rules b/debian/rules index e3a11923b..1acbdbd8d 100755 --- a/debian/rules +++ b/debian/rules | |||
@@ -187,6 +187,9 @@ override_dh_install: $(DISTRIBUTOR_REPLACE) | |||
187 | install -p -m 644 debian/openssh-client.apport debian/openssh-client/usr/share/apport/package-hooks/openssh-client.py | 187 | install -p -m 644 debian/openssh-client.apport debian/openssh-client/usr/share/apport/package-hooks/openssh-client.py |
188 | install -p -m 644 debian/openssh-server.apport debian/openssh-server/usr/share/apport/package-hooks/openssh-server.py | 188 | install -p -m 644 debian/openssh-server.apport debian/openssh-server/usr/share/apport/package-hooks/openssh-server.py |
189 | 189 | ||
190 | # Upstart user job (only used under user sessions) | ||
191 | install -p -m 644 -D debian/ssh-agent.user-session.upstart debian/openssh-client/usr/share/upstart/sessions/ssh-agent.conf | ||
192 | |||
190 | override_dh_installdocs: | 193 | override_dh_installdocs: |
191 | dh_installdocs -Nopenssh-server -Nssh | 194 | dh_installdocs -Nopenssh-server -Nssh |
192 | dh_installdocs -popenssh-server -pssh --link-doc=openssh-client | 195 | dh_installdocs -popenssh-server -pssh --link-doc=openssh-client |
diff --git a/debian/ssh-agent.user-session.upstart b/debian/ssh-agent.user-session.upstart new file mode 100644 index 000000000..8553e12f1 --- /dev/null +++ b/debian/ssh-agent.user-session.upstart | |||
@@ -0,0 +1,19 @@ | |||
1 | description "SSH Agent" | ||
2 | author "Stéphane Graber <stgraber@ubuntu.com>" | ||
3 | |||
4 | start on starting xsession-init | ||
5 | |||
6 | pre-start script | ||
7 | [ -e /etc/X11/Xsession.options ] || { stop; exit 0; } | ||
8 | grep -q "^use-ssh-agent$" /etc/X11/Xsession.options || { stop; exit 0; } | ||
9 | |||
10 | eval "$(ssh-agent)" >/dev/null | ||
11 | initctl set-env --global SSH_AUTH_SOCK=$SSH_AUTH_SOCK | ||
12 | initctl set-env --global SSH_AGENT_PID=$SSH_AGENT_PID | ||
13 | end script | ||
14 | |||
15 | post-stop script | ||
16 | kill $SSH_AGENT_PID 2>/dev/null || true | ||
17 | initctl unset-env --global SSH_AUTH_SOCK | ||
18 | initctl unset-env --global SSH_AGENT_PID | ||
19 | end script | ||