ssh-agent systemd user service failed to start, trying to set environment in Upstart way.

Bug #1689299 reported by Ratchanan Srirattanamet
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
openssh (Ubuntu)
Fix Released
High
Colin Watson

Bug Description

"systemctl --user status ssh-agent.service" give me the following info:
agent-launch[11327]: initctl: Name "com.ubuntu.Upstart" does not exist

As I'm running Systemd session instead of Upstart one, it shouldn't try to run initctl. So, I take a look at /usr/lib/openssh/agent-launcher. And this is what's in the file:

if type initctl >/dev/null 2>&1; then
    initctl set-env --global SSH_AUTH_SOCK=$S
fi

So, the script checks if Upstart is installed, but doesn't actually check if the current session is Upstart session or not. It has to check if $UPSTART_SESSION is defined or not.

$ lsb_release -a
LSB Version: core-9.20160110ubuntu5-amd64:core-9.20160110ubuntu5-noarch:printing-9.20160110ubuntu5-amd64:printing-9.20160110ubuntu5-noarch:security-9.20160110ubuntu5-amd64:security-9.20160110ubuntu5-noarch
Distributor ID: Ubuntu
Description: Ubuntu 17.04
Release: 17.04
Codename: zesty

$ LANG=C apt policy openssh-client
openssh-client:
  Installed: 1:7.4p1-10
  Candidate: 1:7.4p1-10
  Version table:
 *** 1:7.4p1-10 500
        500 http://th.archive.ubuntu.com/ubuntu zesty/main amd64 Packages
        100 /var/lib/dpkg/status

ProblemType: Bug
DistroRelease: Ubuntu 17.04
Package: openssh-client 1:7.4p1-10
ProcVersionSignature: Ubuntu 4.10.0-20.22-generic 4.10.8
Uname: Linux 4.10.0-20-generic x86_64
ApportVersion: 2.20.4-0ubuntu4
Architecture: amd64
CurrentDesktop: Unity:Unity7
Date: Mon May 8 17:51:09 2017
InstallationDate: Installed on 2013-04-23 (1475 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Alpha amd64 (20130402.1)
RelatedPackageVersions:
 ssh-askpass N/A
 libpam-ssh N/A
 keychain N/A
 ssh-askpass-gnome 1:7.4p1-10
SSHClientVersion: OpenSSH_7.4p1 Ubuntu-10, OpenSSL 1.0.2g 1 Mar 2016
SourcePackage: openssh
UpgradeStatus: Upgraded to zesty on 2017-04-29 (9 days ago)

Revision history for this message
Ratchanan Srirattanamet (peat-new) wrote :
Revision history for this message
Colin Watson (cjwatson) wrote :

Good catch, thanks. Fixed in my Debian tree for my next upload.

Changed in openssh (Ubuntu):
assignee: nobody → Colin Watson (cjwatson)
importance: Undecided → High
status: New → Fix Committed
Revision history for this message
Ratchanan Srirattanamet (peat-new) wrote :

Colin, could you please SRU this fix to Zesty as well?

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openssh - 1:7.5p1-5ubuntu1

---------------
openssh (1:7.5p1-5ubuntu1) artful; urgency=low

  * Merge from Debian unstable. Remaining changes:
    - Cherrypick updated patchset to open up sandbox, when openssl engine calls
    into OpenCryptoki for hardware accelerated encryption. LP: #1686618

openssh (1:7.5p1-5) unstable; urgency=medium

  * Upload to unstable.
  * Fix syntax error in debian/copyright.

openssh (1:7.5p1-4) experimental; urgency=medium

  * Drop README.Debian section on privilege separation, as it's no longer
    optional.
  * Only call "initctl set-env" from agent-launch if $UPSTART_SESSION is set
    (LP: #1689299).
  * Fix incoming compression statistics (thanks, Russell Coker; closes:
    #797964).
  * Relicense debian/* under a two-clause BSD licence for bidirectional
    compatibility with upstream, with permission from Matthew Vernon and
    others.

 -- Dimitri John Ledkov <email address hidden> Fri, 28 Jul 2017 14:13:11 +0100

Changed in openssh (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Niklas Holm (niklas-holm) wrote :

I don't get why this fix isn't backported to zesty yet since it's such a trivial fix. I spent hours troubleshooting this before finding the cause.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.