chiark / gitweb /
cgroup: be nice to Ingo Molnar
authorLennart Poettering <lennart@poettering.net>
Tue, 12 Apr 2011 20:15:59 +0000 (22:15 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 12 Apr 2011 20:16:02 +0000 (22:16 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=628004

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

index 5864858dd7e7099011aebcc48ed1b128e18ab1f2..ca19a4fd4768ef55910e64f5337e0184402d6ab3 100644 (file)
@@ -225,6 +225,12 @@ int manager_setup_cgroup(Manager *m) {
 
         assert(m);
 
+        /* 0. Be nice to Ingo Molnar #628004 */
+        if (path_is_mount_point("/sys/fs/cgroup/systemd") <= 0) {
+                log_warning("No control group support available, not creating root group.");
+                return 0;
+        }
+
         /* 1. Determine hierarchy */
         if ((r = cg_get_by_pid(SYSTEMD_CGROUP_CONTROLLER, 0, &current)) < 0) {
                 log_error("Cannot determine cgroup we are running in: %s", strerror(-r));
index 663a72fdd7e9999952d266ee06e0d840638c75d9..3b97fe4aa57c8d4a24cc0c4b67b951d3c7ef9669 100644 (file)
@@ -55,8 +55,8 @@ static const MountPoint mount_table[] = {
         { "tmpfs",    "/dev/shm",               "tmpfs",    "mode=1777",         MS_NOSUID|MS_NODEV,           true },
         { "devpts",   "/dev/pts",               "devpts",   "mode=620,gid=" STRINGIFY(TTY_GID), MS_NOSUID|MS_NOEXEC, false },
         { "tmpfs",    "/run",                   "tmpfs",    "mode=755",          MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
-        { "tmpfs",    "/sys/fs/cgroup",         "tmpfs",    "mode=755",          MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
-        { "cgroup",   "/sys/fs/cgroup/systemd", "cgroup",   "none,name=systemd", MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
+        { "tmpfs",    "/sys/fs/cgroup",         "tmpfs",    "mode=755",          MS_NOSUID|MS_NOEXEC|MS_NODEV, false },
+        { "cgroup",   "/sys/fs/cgroup/systemd", "cgroup",   "none,name=systemd", MS_NOSUID|MS_NOEXEC|MS_NODEV, false },
 };
 
 /* These are API file systems that might be mounted by other software,
@@ -257,7 +257,6 @@ int mount_setup(void) {
         NULSTR_FOREACH_PAIR(j, k, symlinks)
                 symlink_and_label(j, k);
 
-
         /* Create a few directories we always want around */
         mkdir("/run/systemd", 0755);