diff -Nru systemd-shim-9/debian/changelog systemd-shim-9/debian/changelog
--- systemd-shim-9/debian/changelog 2015-06-08 17:56:49.000000000 -0700
+++ systemd-shim-9/debian/changelog 2016-03-01 20:58:51.000000000 -0800
@@ -1,3 +1,12 @@
+systemd-shim (9-1bzr4ubuntu1) xenial; urgency=medium
+
+ * debian/patches/dont-override-release-agent.patch: do not override an
+ existing release agent. If one is defined, something is going on that
+ we don't know about, and we risk stopping user sessions immediately on
+ login (preventing logins).
+
+ -- Serge Hallyn <serge.hallyn@ubuntu.com> Tue, 01 Mar 2016 20:57:52 -0800
+
systemd-shim (9-1bzr4) wily; urgency=medium
* debian/patches/lp1390120.patch
diff -Nru systemd-shim-9/debian/control systemd-shim-9/debian/control
--- systemd-shim-9/debian/control 2015-05-18 07:59:16.000000000 -0700
+++ systemd-shim-9/debian/control 2016-03-01 20:58:56.000000000 -0800
@@ -1,7 +1,8 @@
Source: systemd-shim
Section: admin
Priority: extra
-Maintainer: Steve Langasek <vorlon@debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Steve Langasek <vorlon@debian.org>
Uploaders: Martin Pitt <mpitt@debian.org>
Build-Depends: debhelper (>= 9), dh-autoreconf, libglib2.0-dev, systemd
Standards-Version: 3.9.6
diff -Nru systemd-shim-9/debian/patches/dont-override-release-agent.patch systemd-shim-9/debian/patches/dont-override-release-agent.patch
--- systemd-shim-9/debian/patches/dont-override-release-agent.patch 1969-12-31 16:00:00.000000000 -0800
+++ systemd-shim-9/debian/patches/dont-override-release-agent.patch 2016-03-01 21:02:39.000000000 -0800
@@ -0,0 +1,36 @@
+Description: don't override an existing release agent
+ If someone else has already installed a release agent, do not
+ override it with our own.
+ Without this, if libpam-cgfs is installed to run after pam-systemd,
+ then user sessions are stopped as soon as libpam-cgfs moves the
+ user session to a new cgroup.
+Author: Serge Hallyn <serge.hallyn@ubuntu.com>
+
+Index: systemd-shim-9/src/cgmanager.c
+===================================================================
+--- systemd-shim-9.orig/src/cgmanager.c
++++ systemd-shim-9/src/cgmanager.c
+@@ -163,8 +163,23 @@ cgmanager_remove (const gchar *path)
+ void
+ cgmanager_move_self (void)
+ {
++ GVariant *reply;
++ gchar *str;
++
+ cgmanager_call ("MovePidAbs", g_variant_new ("(ssi)", "all", "/", getpid ()), G_VARIANT_TYPE_UNIT, NULL);
+
++ int need_agent = 1;
++ if (cgmanager_call ("GetValue", g_variant_new ("(sss)", "systemd", "/", "release_agent"), G_VARIANT_TYPE ("(s)"), &reply))
++ {
++ g_variant_get(reply, "(s)", &str);
++ g_variant_unref(reply);
++ need_agent = strlen(str) < 1;
++ g_free(str);
++ }
++
++ if (!need_agent)
++ return;
++
+ /* install our systemd cgroup release handler */
+ g_debug ("Installing cgroup release handler " LIBEXECDIR "/systemd-shim-cgroup-release-agent");
+ cgmanager_call ("SetValue",
diff -Nru systemd-shim-9/debian/patches/series systemd-shim-9/debian/patches/series
--- systemd-shim-9/debian/patches/series 2015-05-18 07:59:16.000000000 -0700
+++ systemd-shim-9/debian/patches/series 2016-03-01 20:54:31.000000000 -0800
@@ -1 +1,2 @@
lp1390120.patch
+dont-override-release-agent.patch