summaryrefslogtreecommitdiff
path: root/examples/source/mount-cgroups/up
diff options
context:
space:
mode:
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}