diff -Nru init-system-helpers-1.22ubuntu9/debian/changelog init-system-helpers-1.22ubuntu10/debian/changelog
--- init-system-helpers-1.22ubuntu9/debian/changelog 2015-04-09 06:10:46.000000000 -0500
+++ init-system-helpers-1.22ubuntu10/debian/changelog 2015-04-09 18:41:13.000000000 -0500
@@ -1,3 +1,10 @@
+init-system-helpers (1.22ubuntu10) vivid; urgency=medium
+
+ * Move /bin/running-in-container from upstart and update it so that
+ systemd-based vivid hosts can use it. (LP: #1442228)
+
+ -- Serge Hallyn <serge.hallyn@ubuntu.com> Thu, 09 Apr 2015 18:40:41 -0500
+
init-system-helpers (1.22ubuntu9) vivid; urgency=medium
Cherry-pick tests and a bug fix from Debian git:
diff -Nru init-system-helpers-1.22ubuntu9/debian/control init-system-helpers-1.22ubuntu10/debian/control
--- init-system-helpers-1.22ubuntu9/debian/control 2015-04-07 11:27:40.000000000 -0500
+++ init-system-helpers-1.22ubuntu10/debian/control 2015-04-09 18:39:43.000000000 -0500
@@ -15,8 +15,8 @@
Architecture: all
Multi-Arch: foreign
Depends: perl-base (>= 5.20.1-3), ${perl:Depends}, ${misc:Depends}
-Breaks: systemd (<< 44-12), upstart (<= 1.13.2-0ubuntu10), upstart-bin (<= 1.13.2-0ubuntu10)
-Replaces: upstart (<= 1.13.2-0ubuntu10), upstart-bin (<= 1.13.2-0ubuntu10)
+Breaks: systemd (<< 44-12), upstart (<< 1.13.2-0ubuntu13), upstart-bin (<< 1.13.2-0ubuntu13)
+Replaces: upstart (<< 1.13.2-0ubuntu13), upstart-bin (<< 1.13.2-0ubuntu13)
Description: helper tools for all init systems
This package contains helper tools that are necessary for switching between
the various init systems that Debian contains (e.g. sysvinit, upstart,
diff -Nru init-system-helpers-1.22ubuntu9/debian/init-system-helpers.install init-system-helpers-1.22ubuntu10/debian/init-system-helpers.install
--- init-system-helpers-1.22ubuntu9/debian/init-system-helpers.install 2015-04-02 11:15:17.000000000 -0500
+++ init-system-helpers-1.22ubuntu10/debian/init-system-helpers.install 2015-04-09 18:30:15.000000000 -0500
@@ -1,3 +1,4 @@
script/deb-systemd-helper usr/bin
script/deb-systemd-invoke usr/bin
script/apparmor-profile-load lib/init
+script/running-in-container bin
diff -Nru init-system-helpers-1.22ubuntu9/script/running-in-container init-system-helpers-1.22ubuntu10/script/running-in-container
--- init-system-helpers-1.22ubuntu9/script/running-in-container 1969-12-31 18:00:00.000000000 -0600
+++ init-system-helpers-1.22ubuntu10/script/running-in-container 2015-04-09 18:29:54.000000000 -0500
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Return 0 if in a container, 1 if not
+# if in a container, also print the container type
+
+if [ -d /run/systemd/system ]; then
+ type systemd-detect-virt > /dev/null 2>&1 || exit 1
+ if type=$(systemd-detect-virt -c); then
+ echo $type
+ exit 0
+ fi
+ exit 1
+fi
+
+# systemd isn't running, so check upstart
+if [ ! -x /sbin/status ]; then
+ # TODO - we might want to consider detecting in sysvinit or others
+ exit 1
+fi
+if status container-detect 2>/dev/null | grep -q start; then
+ [ -f /run/container_type ] && cat /run/container_type
+ exit 0
+fi
+exit 1