summaryrefslogtreecommitdiff
path: root/examples/source/mount-cgroups/up
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-07-12 05:33:01 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-07-12 05:33:01 +0000
commitdb7e83c95875fdc630a4014b323f9fbec205ba6c (patch)
tree41e0ec15c6c8fc4a6abdfa8179327fa083a8729e /examples/source/mount-cgroups/up
parent1cdd470038332a0355d7923483fc7b23cd7e8b7a (diff)
downloads6-rc-db7e83c95875fdc630a4014b323f9fbec205ba6c.tar.xz
Added the example source.
Diffstat (limited to 'examples/source/mount-cgroups/up')
-rw-r--r--examples/source/mount-cgroups/up10
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/source/mount-cgroups/up b/examples/source/mount-cgroups/up
new file mode 100644
index 0000000..5c62b47
--- /dev/null
+++ b/examples/source/mount-cgroups/up
@@ -0,0 +1,10 @@
+if { mkdir -p -m 0755 /sys/fs/cgroup }
+if { s6-mount -wt tmpfs cgroup /sys/fs/cgroup }
+redirfd -r 0 /proc/cgroups
+pipeline { s6-tail -n +2 }
+pipeline { s6-cut -d"\t" -f1 }
+pipeline { s6-grep -vF -- devices }
+forstdin -d"\n" -- i
+import -u i
+if { s6-mkdir /sys/fs/cgroup/${i} }
+s6-mount -t cgroup -o ${i} -- cgroup /sys/fs/cgroup/${i}