aboutsummaryrefslogtreecommitdiffstats
path: root/examples/source/mount-cgroups-sub/up
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2025-05-05 06:29:50 +0000
committerLaurent Bercot <ska@appnovation.com>2025-05-05 06:29:50 +0000
commite18d6958b2470a2e68cc637945ccf3a1dae5c0a2 (patch)
tree90e065e7b7422c2f2dbd5d924dfcd14a2866de39 /examples/source/mount-cgroups-sub/up
parent09ccd3128f2296d3a0cd1602e64caf06cf22c64f (diff)
downloads6-rc-e18d6958b2470a2e68cc637945ccf3a1dae5c0a2.tar.gz
Update examples
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'examples/source/mount-cgroups-sub/up')
-rw-r--r--examples/source/mount-cgroups-sub/up10
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/source/mount-cgroups-sub/up b/examples/source/mount-cgroups-sub/up
new file mode 100644
index 0000000..5f7888d
--- /dev/null
+++ b/examples/source/mount-cgroups-sub/up
@@ -0,0 +1,10 @@
+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
+importas -u i i
+if { s6-mkdir -p /sys/fs/cgroup/${i} }
+foreground { s6-mount -t cgroup -o ${i} -- cgroup /sys/fs/cgroup/${i} }
+importas -u ? ?
+eltest $? -le 1