summaryrefslogtreecommitdiffstats
path: root/src/basic/cgroup-util.c
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2017-11-17 09:47:49 +0100
committerLennart Poettering <lennart@poettering.net>2017-11-17 09:47:49 +0100
commit5535d8f7a941834b19ac7d301fe3844e05ec0b63 (patch)
tree3434be08bb013a893e5fc56424c379aee7f852c7 /src/basic/cgroup-util.c
parentMerge pull request #7314 from poettering/gc-mode (diff)
downloadsystemd-5535d8f7a941834b19ac7d301fe3844e05ec0b63.tar.xz
systemd-5535d8f7a941834b19ac7d301fe3844e05ec0b63.zip
cgroup: assume the use of v1 when all the preceding checks fail (#7366)
This patch restores the default that was changed in 2977724b09eb997fc8, making the tools depending on it work again. Closes: #6477 and https://github.com/lxc/lxc/issues/1669
Diffstat (limited to '')
-rw-r--r--src/basic/cgroup-util.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index 23d4f4a309..b52104768f 100644
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -2460,21 +2460,22 @@ static int cg_unified_update(void) {
log_debug("Found cgroup2 on /sys/fs/cgroup/unified, unified hierarchy for systemd controller");
unified_cache = CGROUP_UNIFIED_SYSTEMD;
unified_systemd_v232 = false;
- } else if (statfs("/sys/fs/cgroup/systemd/", &fs) == 0 &&
- F_TYPE_EQUAL(fs.f_type, CGROUP2_SUPER_MAGIC)) {
- log_debug("Found cgroup2 on /sys/fs/cgroup/systemd, unified hierarchy for systemd controller (v232 variant)");
- unified_cache = CGROUP_UNIFIED_SYSTEMD;
- unified_systemd_v232 = true;
} else {
if (statfs("/sys/fs/cgroup/systemd/", &fs) < 0)
return log_debug_errno(errno, "statfs(\"/sys/fs/cgroup/systemd\" failed: %m");
- if (!F_TYPE_EQUAL(fs.f_type, CGROUP_SUPER_MAGIC)) {
- log_debug("Unexpected filesystem type %llx mounted on /sys/fs/cgroup/systemd.",
+
+ if (F_TYPE_EQUAL(fs.f_type, CGROUP2_SUPER_MAGIC)) {
+ log_debug("Found cgroup2 on /sys/fs/cgroup/systemd, unified hierarchy for systemd controller (v232 variant)");
+ unified_cache = CGROUP_UNIFIED_SYSTEMD;
+ unified_systemd_v232 = true;
+ } else if (F_TYPE_EQUAL(fs.f_type, CGROUP_SUPER_MAGIC)) {
+ log_debug("Found cgroup on /sys/fs/cgroup/systemd, legacy hierarchy");
+ unified_cache = CGROUP_UNIFIED_NONE;
+ } else {
+ log_debug("Unexpected filesystem type %llx mounted on /sys/fs/cgroup/systemd, assuming legacy hierarchy",
(unsigned long long) fs.f_type);
- return -ENOMEDIUM;
+ unified_cache = CGROUP_UNIFIED_NONE;
}
- log_debug("Found cgroup on /sys/fs/cgroup/systemd, legacy hierarchy");
- unified_cache = CGROUP_UNIFIED_NONE;
}
} else {
log_debug("Unknown filesystem type %llx mounted on /sys/fs/cgroup.",