Ubuntu Pastebin

Paste from serge at Wed, 2 Mar 2016 05:03:20 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
diff -Nru cgroup-lite-1.10/debian/changelog cgroup-lite-1.11/debian/changelog
--- cgroup-lite-1.10/debian/changelog	2014-05-12 02:01:36.000000000 -0700
+++ cgroup-lite-1.11/debian/changelog	2016-03-01 12:06:05.000000000 -0800
@@ -1,3 +1,10 @@
+cgroup-lite (1.11) xenial; urgency=medium
+
+  * Mount name=systemd and any other already-existing named subsystems
+    (LP: #1551923)
+
+ -- Serge Hallyn <serge.hallyn@ubuntu.com>  Tue, 01 Mar 2016 12:05:26 -0800
+
 cgroup-lite (1.10) utopic; urgency=medium
 
   * Add masked dummy cgroup-lite.service to avoid package install/upgrade
diff -Nru cgroup-lite-1.10/scripts/cgroups-mount cgroup-lite-1.11/scripts/cgroups-mount
--- cgroup-lite-1.10/scripts/cgroups-mount	2013-03-13 12:48:46.000000000 -0700
+++ cgroup-lite-1.11/scripts/cgroups-mount	2016-03-01 12:05:23.000000000 -0800
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright 2011 Canonical, Inc
+# Copyright 2011-2016 Canonical, Inc
 # Author: Serge Hallyn <serge.hallyn@canonical.com>
 
 set -e
@@ -21,10 +21,23 @@
 # Mount /sys/fs/cgroup if not already done
 mountpoint -q /sys/fs/cgroup || mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup
 
-# get list of cgroup controllers
+# get list of cgroup kernel controllers
 for d in `sed -e '1d;s/\([^\t]\)\t.*$/\1/' /proc/cgroups`; do
 	mkdir -p /sys/fs/cgroup/$d
 	mountpoint -q /sys/fs/cgroup/$d || (mount -n -t cgroup -o $d cgroup /sys/fs/cgroup/$d || rmdir /sys/fs/cgroup/$d || true)
 done
 
+# Find any named controllers which already exist
+for d in `sed -e '/name=/!d;s/^.*name=\([^:]*\).*/\1/' /proc/self/cgroup`; do
+	mkdir -p "/sys/fs/cgroup/${d}"
+	mountpoint -q /sys/fs/cgroup/"${d}" || (mount -n -t cgroup -o none,name="${d}" name="${d}" "/sys/fs/cgroup/${d}" || rmdir "/sys/fs/cgroup/${d}" || true)
+done
+
+# Always mount name=systemd
+dir=/sys/fs/cgroup/systemd
+if [ ! -d "${dir}" ]; then
+	mkdir "${dir}"
+	mount -n -t cgroup -o none,name=systemd name=systemd "${dir}" || rmdir "${dir}" || true
+fi
+
 exit 0
Download as text