summaryrefslogtreecommitdiff
path: root/examples/source/mount-cgroups
diff options
context:
space:
mode:
Diffstat (limited to 'examples/source/mount-cgroups')
-rw-r--r--examples/source/mount-cgroups/dependencies2
-rw-r--r--examples/source/mount-cgroups/down1
-rw-r--r--examples/source/mount-cgroups/type1
-rw-r--r--examples/source/mount-cgroups/up10
4 files changed, 14 insertions, 0 deletions
diff --git a/examples/source/mount-cgroups/dependencies b/examples/source/mount-cgroups/dependencies
new file mode 100644
index 0000000..0a09446
--- /dev/null
+++ b/examples/source/mount-cgroups/dependencies
@@ -0,0 +1,2 @@
+mount-sys
+mount-proc
diff --git a/examples/source/mount-cgroups/down b/examples/source/mount-cgroups/down
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/examples/source/mount-cgroups/down
@@ -0,0 +1 @@
+
diff --git a/examples/source/mount-cgroups/type b/examples/source/mount-cgroups/type
new file mode 100644
index 0000000..bdd22a1
--- /dev/null
+++ b/examples/source/mount-cgroups/type
@@ -0,0 +1 @@
+oneshot
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}