summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-09-24 11:35:51 +0200
committerLennart Poettering <lennart@poettering.net>2012-09-24 11:35:51 +0200
commita07fdfa376add41d9101d39db25fb2ecb17d5fca (patch)
tree57fc356c800cdcd51971a193ce94b23dc55da624 /src/core
parent8e41de0d2c468b8a351775b431b9d21f42dd7aaa (diff)
main: don't try to mout cpuset with cpu+cpuacct anymore
Turns out cpuset needs explicit initialization before we could make use of it. Thus mounting cpuset with cpu/cpuacct would make it impossible to just create a group in "cpu" and start it.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/main.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 04fc0b3b59..f9aba46b58 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1227,6 +1227,28 @@ static void test_cgroups(void) {
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
+ * "cpuset" does't really work for groups with no initialized
+ * attributes. */
+
+ arg_join_controllers = new(char**, 3);
+ if (!arg_join_controllers)
+ return -ENOMEM;
+
+ arg_join_controllers[0] = strv_new("cpu", "cpuacct", NULL);
+ if (!arg_join_controllers[0])
+ return -ENOMEM;
+
+ arg_join_controllers[1] = strv_new("net_cls", "net_prio", NULL);
+ if (!arg_join_controllers[1])
+ return -ENOMEM;
+
+ arg_join_controllers[2] = NULL;
+ return 0;
+}
+
int main(int argc, char *argv[]) {
Manager *m = NULL;
int r, retval = EXIT_FAILURE;
@@ -1371,16 +1393,8 @@ int main(int argc, char *argv[]) {
goto finish;
}
- /* By default, mount "cpu" and "cpuacct" together */
- arg_join_controllers = new(char**, 3);
- if (!arg_join_controllers)
- goto finish;
-
- arg_join_controllers[0] = strv_new("cpu", "cpuacct", "cpuset", NULL);
- arg_join_controllers[1] = strv_new("net_cls", "net_prio", NULL);
- arg_join_controllers[2] = NULL;
-
- if (!arg_join_controllers[0])
+ r = initialize_join_controllers();
+ if (r < 0)
goto finish;
/* Mount /proc, /sys and friends, so that /proc/cmdline and