FWIW something like:
for d in `tail -n +2 /tmp/2 | awk '{ if ($2 == 0) print $1 else if (a[$2]) a[$2] = a[$2]","$1 else a[$2]=$1 };END{ for(i in a) { print a[i] } }'`; 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
seems to work. Again excluding the possibility of unified hierarchy, which I've not tested.
FWIW something like:
for d in `tail -n +2 /tmp/2 | awk '{
print $1
a[$2] = a[$2]","$1
a[$2] =$1
print a[i]
if ($2 == 0)
else if (a[$2])
else
};END{
for(i in a) {
}
}'`; 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
seems to work. Again excluding the possibility of unified hierarchy, which I've not tested.