=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2017-03-20 10:13:50 +0000
+++ CMakeLists.txt	2017-04-24 12:41:34 +0000
@@ -85,9 +85,6 @@
 pkg_check_modules(LTTNG REQUIRED lttng-ust)
 include_directories(${LTTNG_INCLUDE_DIRS})
 
-pkg_check_modules(CGMANAGER REQUIRED libcgmanager)
-include_directories(${CGMANAGER_INCLUDE_DIRS})
-
 pkg_check_modules(MIR REQUIRED mirclient)
 include_directories(${MIR_INCLUDE_DIRS})
 

=== modified file 'debian/control'
--- debian/control	2017-03-28 13:45:10 +0000
+++ debian/control	2017-04-24 12:41:34 +0000
@@ -9,7 +9,6 @@
                dbus-test-runner,
                debhelper (>= 9),
                googletest | google-mock,
-               libcgmanager-dev,
                libcurl4-dev | libcurl4-gnutls-dev,
                libdbus-1-dev,
                libdbustest1-dev (>= 14.04.0),

=== modified file 'libubuntu-app-launch/utils-shared.c'
--- libubuntu-app-launch/utils-shared.c	2017-02-22 22:50:19 +0000
+++ libubuntu-app-launch/utils-shared.c	2017-04-24 12:41:34 +0000
@@ -19,7 +19,6 @@
 
 #include "utils.h"
 #include <gio/gio.h>
-#include <cgmanager/cgmanager.h>
 
 #include "ual-tracepoint.h"
 
@@ -97,202 +96,6 @@
 	return keyfile;
 }
 
-/* Structure to handle data for the cgmanager connection
-   set of callbacks */
-typedef struct {
-	GMainLoop * loop;
-	GCancellable * cancel;
-	GDBusConnection * con;
-} cgm_connection_t;
-
-/* Function that gets executed when we timeout trying to connect. This
-   is related to: LP #1377332 */
-static gboolean
-cgroup_manager_connection_timeout_cb (gpointer data)
-{
-	cgm_connection_t * connection = (cgm_connection_t *)data;
-
-	g_cancellable_cancel(connection->cancel);
-
-	return G_SOURCE_CONTINUE;
-}
-
-static void
-cgroup_manager_connection_core_cb (GDBusConnection *(*finish_func)(GAsyncResult * res, GError ** error), GAsyncResult * res, cgm_connection_t * connection)
-{
-	GError * error = NULL;
-
-	connection->con = finish_func(res, &error);
-
-	if (error != NULL) {
-		g_warning("Unable to get cgmanager connection: %s", error->message);
-		g_error_free(error);
-	}
-
-	g_main_loop_quit(connection->loop);
-}
-
-static void
-cgroup_manager_connection_bus_cb (GObject * obj, GAsyncResult * res, gpointer data)
-{
-	cgroup_manager_connection_core_cb(g_bus_get_finish, res, (cgm_connection_t *)data);
-}
-
-static void
-cgroup_manager_connection_addr_cb (GObject * obj, GAsyncResult * res, gpointer data)
-{
-	cgroup_manager_connection_core_cb(g_dbus_connection_new_for_address_finish, res, (cgm_connection_t *)data);
-}
-
-G_DEFINE_QUARK(CGMANAGER_CONTEXT, cgmanager_context)
-
-/* Get the connection to the cgroup manager */
-GDBusConnection *
-cgroup_manager_connection (void)
-{
-	gboolean use_session_bus = g_getenv("UBUNTU_APP_LAUNCH_CG_MANAGER_SESSION_BUS") != NULL;
-	GMainContext * context = g_main_context_new();
-	g_main_context_push_thread_default(context);
-
-	cgm_connection_t connection = {
-		.loop = g_main_loop_new(context, FALSE),
-		.con = NULL,
-		.cancel = g_cancellable_new()
-	};
-	
-	GSource * timesrc = g_timeout_source_new_seconds(1);
-	g_source_set_callback(timesrc, cgroup_manager_connection_timeout_cb, &connection, NULL);
-	g_source_attach(timesrc, context);
-
-	if (use_session_bus) {
-		/* For working dbusmock */
-		g_debug("Connecting to CG Manager on session bus");
-		g_bus_get(G_BUS_TYPE_SESSION,
-			connection.cancel,
-			cgroup_manager_connection_bus_cb,
-			&connection);
-	} else {
-		g_dbus_connection_new_for_address(
-			CGMANAGER_DBUS_PATH,
-			G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT,
-			NULL, /* Auth Observer */
-			connection.cancel, /* Cancellable */
-			cgroup_manager_connection_addr_cb,
-			&connection);
-	}
-
-	g_main_loop_run(connection.loop);
-
-	g_source_destroy(timesrc);
-	g_source_unref(timesrc);
-
-	g_main_loop_unref(connection.loop);
-	g_object_unref(connection.cancel);
-
-	g_main_context_pop_thread_default(context);
-
-	if (!use_session_bus && connection.con != NULL) {
-		g_object_set_qdata(G_OBJECT(connection.con),
-		                   cgmanager_context_quark(),
-		                   context);
-	} else {
-		g_main_context_unref(context);
-	}
-
-	return connection.con;
-}
-
-/* This does a complex unref for the case that we're not using a shared
-   pointer. In that case the initialization happens under the context that
-   we used for the timeout, and it turns out GDBus saves that context to
-   use for the close event. Upon the task closing it sends an idle source
-   to that context which free's the last bit of memory. So we need the events
-   on that context to be executed or we just leak. So what this does is force
-   a close synchronously so that the event gets placed on the context and then
-   frees the context to ensure that all of the events are processed. */
-void
-cgroup_manager_unref (GDBusConnection * cgmanager)
-{
-	if (cgmanager == NULL)
-		return;
-
-	GMainContext * creationcontext = g_object_get_qdata(G_OBJECT(cgmanager), cgmanager_context_quark());
-	if (creationcontext == NULL) {
-		g_object_unref(cgmanager);
-		return;
-	}
-
-	GError * error = NULL;
-	g_dbus_connection_close_sync(cgmanager, NULL, &error);
-
-	if (error != NULL) {
-		g_warning("Unable to close CGManager Connection: %s", error->message);
-		g_error_free(error);
-	}
-
-	g_object_unref(cgmanager);
-
-	while (g_main_context_pending(creationcontext)) {
-		g_main_context_iteration(creationcontext, TRUE /* may block */);
-	}
-
-	g_main_context_unref(creationcontext);
-}
-
-/* Get the PIDs for a particular cgroup */
-/* We're using the base cgroup 'freezer' in this code (and
-   in the Upstart jobs). Really the actual group is meaningless
-   we just need one that is in every kernel we need to support.
-   We're just using the cgroup as a bag of PIDs, not for
-   restricting any particular resource. */
-GList *
-pids_from_cgroup (GDBusConnection * cgmanager, const gchar * jobname, const gchar * instancename)
-{
-	GError * error = NULL;
-	const gchar * name = g_getenv("UBUNTU_APP_LAUNCH_CG_MANAGER_NAME");
-	gchar * groupname = NULL;
-	if (jobname != NULL) {
-		groupname = g_strdup_printf("upstart/%s-%s", jobname, instancename);
-	}
-
-	g_debug("Looking for cg manager '%s' group '%s'", name, groupname);
-
-	GVariant * vtpids = g_dbus_connection_call_sync(cgmanager,
-		name, /* bus name for direct connection is NULL */
-		"/org/linuxcontainers/cgmanager",
-		"org.linuxcontainers.cgmanager0_0",
-		"GetTasksRecursive",
-		g_variant_new("(ss)", "freezer", groupname ? groupname : ""),
-		G_VARIANT_TYPE("(ai)"),
-		G_DBUS_CALL_FLAGS_NONE,
-		-1, /* default timeout */
-		NULL, /* cancellable */
-		&error);
-
-	g_free(groupname);
-
-	if (error != NULL) {
-		g_warning("Unable to get PID list from cgroup manager: %s", error->message);
-		g_error_free(error);
-		return NULL;
-	}
-
-	GVariant * vpids = g_variant_get_child_value(vtpids, 0);
-	GVariantIter iter;
-	g_variant_iter_init(&iter, vpids);
-	gint32 pid;
-	GList * retval = NULL;
-
-	while (g_variant_iter_loop(&iter, "i", &pid)) {
-		retval = g_list_prepend(retval, GINT_TO_POINTER(pid));
-	}
-
-	g_variant_unref(vpids);
-	g_variant_unref(vtpids);
-
-	return retval;
-}
-
 /* Global markers for the ual_tracepoint macro */
 int _ual_tracepoints_env_checked = 0;
 int _ual_tracepoints_enabled = 0;

=== modified file 'libubuntu-app-launch/utils.h'
--- libubuntu-app-launch/utils.h	2017-03-15 14:05:17 +0000
+++ libubuntu-app-launch/utils.h	2017-04-24 12:41:34 +0000
@@ -38,12 +38,6 @@
                                           int timeout_s);
 void      starting_handshake_wait        (handshake_t *   handshake);
 
-GDBusConnection * cgroup_manager_connection (void);
-void              cgroup_manager_unref (GDBusConnection * cgroup_manager);
-GList *   pids_from_cgroup       (GDBusConnection * cgmanager,
-                                  const gchar *   jobname,
-                                  const gchar *   instancename);
-
 gboolean   verify_keyfile        (GKeyFile *    inkeyfile,
                                   const gchar * desktop);
 

