quota group error should be more explanative when memory cgroup is disabled

Bug #1945370 reported by Ian Johnson
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Triaged
High
Burak Ates

Bug Description

On a system like the raspberry pi (see https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1945369) where the memory cgroup is disabled, we currently just fail like this trying to query the status of the quota group:

$ snap quotas
error: memory usage unavailable

When really we should query and figure out that the memory cgroup is actually disabled, see:

$ cat /proc/cgroups
#subsys_name hierarchy num_cgroups enabled
cpuset 2 1 1
cpu 4 100 1
cpuacct 4 100 1
blkio 5 100 1
memory 0 109 0
devices 6 100 1
freezer 9 4 1
net_cls 3 1 1
perf_event 10 1 1
net_prio 3 1 1
pids 8 107 1
rdma 7 1 1

A more informative error message would be something like:

$ snap quotas
error: memory cgroup disabled on this system

This applies not just to the quotas command, any quota manipulation should error out with a message like this, at least until we support other resource types for quotas in which case we may need to do something more specialized.

X-HWE-Bug: Bug #1952823

Changed in snapd:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Burak Ates (atesburak) wrote :

Added a check prior to control group actions to see if the memory control group is enabled see PR=>https://github.com/snapcore/snapd/pull/11003

Changed in snapd:
assignee: nobody → Burak Ates (atesburak)
Yao Wei (medicalwei)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.