1 702111 - Starting LSB: start and stop the WLM configuration failed
3 - cgconfigparser should not unmount stuff it did not mounted
4 - cgconfigparser should accept empty config file
7 Backported these 3 pacthes:
9 commit 7155cc27430619be5ffcf1ddc2b6bd8cf7d6d7e0
10 Author: Dhaval Giani <dhaval.giani@gmail.com>
11 Date: Fri May 27 10:36:19 2011 +0200
13 cgconfig: Do not touch subsystems not mounted by cgconfig
15 cgconfig: Do not touch subsystems not mounted by cgconfig
17 In its failure path, cgconfig should only touch the subsystems
18 it had something to do with. Currently, it unmounts all the
19 subsystems in the config file. Correct this.
21 Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
22 Signed-off-by: Jan Safranek <jsafrane@redhat.com>
24 commit 431587f4e21b36a3f08bc595d716a70d70314e70
25 Author: Jan Safranek <jsafrane@redhat.com>
26 Date: Fri May 20 15:53:05 2011 +0200
28 Updated cgconfig service descriptions
30 Signed-off-by: Jan Safranek <jsafrane@redhat.com>
32 commit 74e1b1e3d04c2f7999e367a20bf73396b61f9b64
33 Author: Jan Safranek <jsafrane@redhat.com>
34 Date: Fri May 20 15:52:58 2011 +0200
36 Fixed cgconfigparser to allow configs with no 'mount' section
38 cgconfig service fails when something else mounts cgroup hierarchies during
39 boot (e.g. systemd). Therefore we should allow cgconfig.conf to have no
40 'mount' section -> it's up to admin to ensure that controllers are mounted as
43 Because 'group' section is already optional, with this patch cgconfigparser
44 will accept empty configuration file. This is probably the best default
45 config for distros with systemd.
48 - fixed case with empty config file and no mounted controllers
49 - reworked the if conditions to be more clear
51 Signed-off-by: Jan Safranek <jsafrane@redhat.com>
53 diff -up libcgroup-0.37.1/doc/man/cgconfig.conf.5.systemd2 libcgroup-0.37.1/doc/man/cgconfig.conf.5
54 --- libcgroup-0.37.1/doc/man/cgconfig.conf.5.systemd2 2011-03-03 09:29:41.000000000 +0100
55 +++ libcgroup-0.37.1/doc/man/cgconfig.conf.5 2011-05-30 15:06:45.083249011 +0200
56 @@ -12,8 +12,8 @@ The file consists of
60 -sections. These sections can be in arbitrary order. Any line starting with
61 -'#' is considered as a comment line and is ignored.
62 +sections. These sections can be in arbitrary order and both are optional.
63 +Any line starting with '#' is considered as a comment line and is ignored.
66 section has this form:
67 @@ -50,6 +50,11 @@ controller, shall be mounted. The direct
68 automatically on cgconfig service startup if it does not exist and
69 is deleted on service shutdown.
74 +section is specified, no controllers are mounted.
77 section has this form:
79 @@ -171,6 +176,10 @@ created. Optionally it can be enclosed i
85 +section is specified, no groups are created.
87 .\"********************************************"
90 diff -up libcgroup-0.37.1/scripts/init.d/cgconfig.in.systemd2 libcgroup-0.37.1/scripts/init.d/cgconfig.in
91 --- libcgroup-0.37.1/scripts/init.d/cgconfig.in.systemd2 2011-05-30 15:00:36.269947252 +0200
92 +++ libcgroup-0.37.1/scripts/init.d/cgconfig.in 2011-05-30 15:00:36.284946695 +0200
97 -# Short-Description: start and stop the WLM configuration
98 -# Description: This script allows us to create a default configuration
99 +# Short-Description: Create and setup control group filesystem(s)
100 +# Description: Create and setup control group filesystem(s)
103 # get correct location of binaries from configure
104 diff -up libcgroup-0.37.1/src/config.c.systemd2 libcgroup-0.37.1/src/config.c
105 --- libcgroup-0.37.1/src/config.c.systemd2 2011-03-03 09:29:41.000000000 +0100
106 +++ libcgroup-0.37.1/src/config.c 2011-05-30 15:17:08.317101247 +0200
107 @@ -394,6 +394,7 @@ static int cgroup_config_mount_fs(void)
113 for (i = 0; i < config_table_index; i++) {
114 struct cg_mount_table_s *curr = &(config_mount_table[i]);
115 @@ -402,26 +403,39 @@ static int cgroup_config_mount_fs(void)
117 if (ret < 0 && errno != ENOENT) {
124 if (errno == ENOENT) {
125 ret = cg_mkdir_p(curr->path);
132 } else if (!S_ISDIR(buff.st_mode)) {
140 ret = mount(CGROUP_FILESYSTEM, curr->path, CGROUP_FILESYSTEM,
144 - return ECGMOUNTFAIL;
146 + error = ECGMOUNTFAIL;
153 + * If we come here, we have failed. Since we have touched only
154 + * mountpoints prior to i, we shall operate on only them now.
156 + config_table_index = 1;
161 @@ -681,24 +695,25 @@ int cgroup_config_load_config(const char
162 mount_enabled = (config_mount_table[0].name[0] != '\0');
165 - * The configuration should have either namespace or mount.
166 - * Not both and not none.
167 + * The configuration should have namespace or mount, not both.
169 - if (namespace_enabled == mount_enabled) {
170 + if (namespace_enabled && mount_enabled) {
171 free(config_cgroup_table);
172 return ECGMOUNTNAMESPACE;
176 - * We do not allow both mount and namespace sections in the
177 - * same configuration file. So test for that
180 error = cgroup_config_mount_fs();
184 error = cgroup_init();
185 + if (error == ECGROUPNOTMOUNTED && cgroup_table_index == 0) {
187 + * The config file seems to be empty.