# description : 'time epoch for time clients')
#else
description : '''Wanted cgroup hierarchy if elogind has to be a cgroup controller:
- "legacy" assumes cgroups version 1 mounted on /sys/fs/cgroup
- "hybrid" assumes cgroups version 2 mounted on /sys/fs/cgroup/unified and
- cgroups version 1 mounted on /sys/fs/cgroup.
+ "legacy" assumes tmpfs mounted on /sys/fs/cgroup and cgroup on its
+ subfolders.
+ "hybrid" assumes cgroups version 2 mounted on /sys/fs/cgroup/unified.
+ /sys/fs/cgroup is legacy, then.
"unified" assumes cgroups version 2 on /sys/fs/cgroup''')
option('cgroup-controller', type : 'string',
description : 'Name of the cgroup controller to use')
bool cg_is_unified_wanted(void) {
static thread_local int wanted = -1;
+#if 0 /// UNNEEDED by elogind
int r;
bool b;
+#endif // 0
const bool is_default = DEFAULT_HIERARCHY == CGROUP_UNIFIED_ALL;
/* If we have a cached value, return that. */
/* Otherwise, let's see what the kernel command line has to say.
* Since checking is expensive, cache a non-error result. */
r = proc_cmdline_get_bool("systemd.unified_cgroup_hierarchy", &b);
-#endif // 0
return (wanted = r > 0 ? b : is_default);
+#else
+ return is_default;
+#endif // 0
}
bool cg_is_legacy_wanted(void) {
bool cg_is_hybrid_wanted(void) {
static thread_local int wanted = -1;
+#if 0 /// UNNEEDED by elogind
int r;
bool b;
+#endif // 0
const bool is_default = DEFAULT_HIERARCHY >= CGROUP_UNIFIED_SYSTEMD;
/* We default to true if the default is "hybrid", obviously,
* but also when the default is "unified", because if we get
/* Otherwise, let's see what the kernel command line has to say.
* Since checking is expensive, cache a non-error result. */
r = proc_cmdline_get_bool("systemd.legacy_systemd_cgroup_controller", &b);
-#endif // 0
/* The meaning of the kernel option is reversed wrt. to the return value
* of this function, hence the negation. */
return (wanted = r > 0 ? !b : is_default);
+#else
+ return is_default;
+#endif // 0
}
#if 0 /// UNNEEDED by elogind
#endif
{ "tmpfs", "/run", "tmpfs", "mode=755", MS_NOSUID|MS_NODEV|MS_STRICTATIME,
NULL, MNT_FATAL|MNT_IN_CONTAINER },
+#endif // 0
{ "cgroup2", "/sys/fs/cgroup", "cgroup2", "nsdelegate", MS_NOSUID|MS_NOEXEC|MS_NODEV,
cg_is_unified_wanted, MNT_IN_CONTAINER|MNT_CHECK_WRITABLE },
{ "cgroup2", "/sys/fs/cgroup", "cgroup2", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
cg_is_unified_wanted, MNT_IN_CONTAINER|MNT_CHECK_WRITABLE },
-#endif // 0
{ "tmpfs", "/sys/fs/cgroup", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_STRICTATIME,
cg_is_legacy_wanted, MNT_FATAL|MNT_IN_CONTAINER },
{ "cgroup2", "/sys/fs/cgroup/unified", "cgroup2", "nsdelegate", MS_NOSUID|MS_NOEXEC|MS_NODEV,
#else
{ "cgroup", "/sys/fs/cgroup/elogind", "cgroup", "none,name=elogind,release_agent="SYSTEMD_CGROUP_AGENT_PATH",xattr", MS_NOSUID|MS_NOEXEC|MS_NODEV,
cg_is_legacy_wanted, MNT_IN_CONTAINER },
- { "cgroup", "/sys/fs/cgroup/elogind", "cgroup", "none,name=elogind,release_agent="SYSTEMD_CGROUP_AGENT_PATH, MS_NOSUID|MS_NOEXEC|MS_NODEV,
+ { "cgroup", "/sys/fs/cgroup/eloignd", "cgroup", "none,name=elogind,release_agent="SYSTEMD_CGROUP_AGENT_PATH, MS_NOSUID|MS_NOEXEC|MS_NODEV,
cg_is_legacy_wanted, MNT_FATAL|MNT_IN_CONTAINER },
#endif // 0
};