When supervisor is starting up it asks the following questions:
is /sys/fs/cgroup mounted with with a device name of "cgroupsRoot" for each ["cpu,cpuacct", "memory", "freezer"] as subsys is /sys/fs/cgroup/<subsys> mounted with a device name of <subsys>
If any of those tests fail then Legato mounts the required cgroups itself.
All of this is fine, except that it is following an odd convention that can’t be depended on. Certainly on our AGL-derived build this is not quite the way those directories are mounted.
It doesn’t really matter what the device names are. What matters is the location and type of file system. Here is my mod to do just that.
is /sys/fs/cgroup mounted with with a fs type of "tmpfs" for each ["cpu,cpuacct", "memory", "freezer"] as subsys is /sys/fs/cgroup/<subsys> mounted with a fs type of "cgroup"
I guess you could go the extra mile and test the options the fs was mounted with, and make sure “memory” was mounted as a cgroup with the option “memory”. But who would do something so intentionally confusing?
Here’s my changes: