mirror of
https://github.com/systemd/systemd.git
synced 2024-11-06 08:26:52 +03:00
core: require cgroups filesystem to be available
We should no longer pretend that we can run in any sensible way without the kernel supporting us with cgroups functionality.
This commit is contained in:
parent
61fb23db45
commit
99a17ada9c
@ -862,12 +862,6 @@ int manager_setup_cgroup(Manager *m) {
|
||||
|
||||
assert(m);
|
||||
|
||||
/* 0. Be nice to Ingo Molnar #628004 */
|
||||
if (path_is_mount_point("/sys/fs/cgroup/systemd", false) <= 0) {
|
||||
log_warning("No control group support available, not creating root group.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 1. Determine hierarchy */
|
||||
free(m->cgroup_root);
|
||||
m->cgroup_root = NULL;
|
||||
|
@ -1184,21 +1184,6 @@ static void test_usr(void) {
|
||||
"Consult http://freedesktop.org/wiki/Software/systemd/separate-usr-is-broken for more information.");
|
||||
}
|
||||
|
||||
static void test_cgroups(void) {
|
||||
|
||||
if (access("/proc/cgroups", F_OK) >= 0)
|
||||
return;
|
||||
|
||||
log_warning("CONFIG_CGROUPS was not set when your kernel was compiled. "
|
||||
"Systems without control groups are not supported. "
|
||||
"We will now sleep for 10s, and then continue boot-up. "
|
||||
"Expect breakage and please do not file bugs. "
|
||||
"Instead fix your kernel and enable CONFIG_CGROUPS. "
|
||||
"Consult http://0pointer.de/blog/projects/cgroups-vs-cgroups.html for more information.");
|
||||
|
||||
sleep(10);
|
||||
}
|
||||
|
||||
static int initialize_join_controllers(void) {
|
||||
/* By default, mount "cpu" + "cpuacct" together, and "net_cls"
|
||||
* + "net_prio". We'd like to add "cpuset" to the mix, but
|
||||
@ -1586,7 +1571,6 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
test_mtab();
|
||||
test_usr();
|
||||
test_cgroups();
|
||||
}
|
||||
|
||||
if (arg_running_as == SYSTEMD_SYSTEM && arg_runtime_watchdog > 0)
|
||||
|
@ -92,13 +92,13 @@ static const MountPoint mount_table[] = {
|
||||
{ "tmpfs", "/run", "tmpfs", "mode=755", MS_NOSUID|MS_NODEV|MS_STRICTATIME,
|
||||
NULL, MNT_FATAL|MNT_IN_CONTAINER },
|
||||
{ "tmpfs", "/sys/fs/cgroup", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_STRICTATIME,
|
||||
NULL, MNT_IN_CONTAINER },
|
||||
NULL, MNT_FATAL|MNT_IN_CONTAINER },
|
||||
#ifdef HAVE_XATTR
|
||||
{ "cgroup", "/sys/fs/cgroup/systemd", "cgroup", "none,name=systemd,xattr", MS_NOSUID|MS_NOEXEC|MS_NODEV,
|
||||
NULL, MNT_IN_CONTAINER },
|
||||
NULL, MNT_FATAL|MNT_IN_CONTAINER },
|
||||
#endif
|
||||
{ "cgroup", "/sys/fs/cgroup/systemd", "cgroup", "none,name=systemd", MS_NOSUID|MS_NOEXEC|MS_NODEV,
|
||||
NULL, MNT_IN_CONTAINER },
|
||||
NULL, MNT_FATAL|MNT_IN_CONTAINER },
|
||||
{ "pstore", "/sys/fs/pstore", "pstore", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
|
||||
NULL, MNT_NONE },
|
||||
#ifdef ENABLE_EFI
|
||||
@ -188,7 +188,7 @@ static int mount_one(const MountPoint *p, bool relabel) {
|
||||
p->type,
|
||||
p->flags,
|
||||
p->options) < 0) {
|
||||
log_full((p->mode & MNT_FATAL) ? LOG_ERR : LOG_DEBUG, "Failed to mount %s: %m", p->where);
|
||||
log_full((p->mode & MNT_FATAL) ? LOG_ERR : LOG_DEBUG, "Failed to mount %s at %s: %m", p->type, p->where);
|
||||
return (p->mode & MNT_FATAL) ? -errno : 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user