Bug#883253: ssh-agent.service missing dbus dependency
Package: openssh-client
Version: 1:7.6p1-2
Tags: patch
/usr/lib/systemd/user/ssh-agent.service executes
/usr/lib/openssh/agent-launch which invokes
dbus-update-activation-environment. However, ssh-agent.service is missing
a dependency on dbus, so it may fail as follows:
$ systemctl --user --full status ssh-agent.service
● ssh-agent.service - OpenSSH Agent
Loaded: loaded (/usr/lib/systemd/user/ssh-agent.service; static; vendor preset: enabled)
Active: inactive (dead)
Dec 01 05:26:21 change-mode agent-launch[30342]: dbus-update-activation-environment: setting SSH_AUTH_SOCK=/run/user/1000/openssh_agent
Dec 01 05:26:21 change-mode agent-launch[30342]: dbus-update-activation-environment: setting SSH_AGENT_LAUNCHER=openssh
Dec 01 05:26:21 change-mode agent-launch[30342]: SSH_AUTH_SOCK=/run/user/1000/openssh_agent; export SSH_AUTH_SOCK;
Dec 01 05:26:21 change-mode agent-launch[30342]: echo Agent pid 30342;
Dec 01 05:28:14 change-mode systemd[25213]: Stopping OpenSSH Agent...
Dec 01 05:28:14 change-mode systemd[25213]: ssh-agent.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 01 05:28:14 change-mode agent-launch[30754]: dbus-update-activation-environment: error: unable to connect to D-Bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Dec 01 05:28:14 change-mode systemd[25213]: ssh-agent.service: Control process exited, code=exited status=71
Dec 01 05:28:14 change-mode systemd[25213]: ssh-agent.service: Failed with result 'exit-code'.
Dec 01 05:28:14 change-mode systemd[25213]: Stopped OpenSSH Agent.
This should be fixed by adding Wants=dbus.socket and After=dbus.socket to
ssh-agent.service.
diff -Nru openssh-7.6p1/debian/changelog openssh-7.6p1/debian/changelog
--- openssh-7.6p1/debian/changelog 2017-10-07 08:44:13.000000000 -0400
+++ openssh-7.6p1/debian/changelog 2017-12-01 05:52:35.000000000 -0500
@@ -1,3 +1,9 @@
+openssh (1:7.6p1-3) unstable; urgency=medium
+
+ * debian/systemd/ssh-agent.service: Add missing dbus dependency.
+
+ -- Anders Kaseorg <andersk@mit.edu> Fri, 01 Dec 2017 05:52:35 -0500
+
openssh (1:7.6p1-2) unstable; urgency=medium
* Apply upstream patch to fix PermitOpen argument handling.
diff -Nru openssh-7.6p1/debian/systemd/ssh-agent.service openssh-7.6p1/debian/systemd/ssh-agent.service
--- openssh-7.6p1/debian/systemd/ssh-agent.service 2017-10-07 08:43:16.000000000 -0400
+++ openssh-7.6p1/debian/systemd/ssh-agent.service 2017-12-01 05:52:35.000000000 -0500
@@ -2,6 +2,8 @@
Description=OpenSSH Agent
Before=graphical-session-pre.target
ConditionPathExists=/etc/X11/Xsession.options
+Wants=dbus.socket
+After=dbus.socket
[Service]
ExecStart=/usr/lib/openssh/agent-launch start
Reply to: