]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: require cgroups filesystem to be available
authorKay Sievers <kay@vrfy.org>
Mon, 5 May 2014 16:49:43 +0000 (18:49 +0200)
committerKay Sievers <kay@vrfy.org>
Mon, 5 May 2014 16:52:36 +0000 (18:52 +0200)
We should no longer pretend that we can run in any sensible way
without the kernel supporting us with cgroups functionality.

src/core/cgroup.c
src/core/main.c
src/core/mount-setup.c

index 1c05c23449b06818ddec1a315ce3f9f7d4ef8c5a..3aeaf5665622dc41cd85d47337af59308ccf8f21 100644 (file)
@@ -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;
index a6a5aa70f2590c21d7121d04ba23c2261b0b6d81..c1b0ffd9bb1e66e36bd75358dd5d077c47183d37 100644 (file)
@@ -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)
index 0a45b247743ca22a0a23db7c96e87d24e4998e86..34d71e5b4047e76df896a1a89f0df4e732ee4f3d 100644 (file)
@@ -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;
         }