]> git.pld-linux.org Git - packages/libcgroup.git/commitdiff
- rel 3; systemd patches from fc auto/th/libcgroup-0_37_1-3
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 29 Jan 2012 10:57:42 +0000 (10:57 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    libcgroup-0.36.2-systemd.patch -> 1.1
    libcgroup-0.37.1-systemd.patch -> 1.1
    libcgroup.spec -> 1.24

libcgroup-0.36.2-systemd.patch [new file with mode: 0644]
libcgroup-0.37.1-systemd.patch [new file with mode: 0644]
libcgroup.spec

diff --git a/libcgroup-0.36.2-systemd.patch b/libcgroup-0.36.2-systemd.patch
new file mode 100644 (file)
index 0000000..e1cf0c5
--- /dev/null
@@ -0,0 +1,24 @@
+Ignore systemd hierarchy. Quick&dirity fix for bug #627378
+
+Author: Dhaval Giani <dhaval.bugzilla@thegianis.in>
+
+@@ -, +, @@ 
+ src/api.c |    8 ++++++++
+ 1 file changed, 8 insertions(+)
+--- libcgroup-0.36.2/src/api.c 
++++ libcgroup-0.36.2/src/api.c 
+@@ -772,6 +772,14 @@ int cgroup_init(void)
+                        * Check if it is a duplicate
+                        */
+                       duplicate = 0;
++
++                      /*
++                       * Ignore anything to do with systemd
++                       */
++                      if (strncmp(mntopt, "name=systemd",
++                                              strlen("name=systemd")) == 0)
++                                      continue;
++
+                       for (j = 0; j < found_mnt; j++) {
+                               if (strncmp(mntopt, cg_mount_table[j].name,
+                                                       FILENAME_MAX) == 0) {
diff --git a/libcgroup-0.37.1-systemd.patch b/libcgroup-0.37.1-systemd.patch
new file mode 100644 (file)
index 0000000..8512201
--- /dev/null
@@ -0,0 +1,194 @@
+702111 - Starting LSB: start and stop the WLM configuration failed
+
+ - cgconfigparser should not unmount stuff it did not mounted
+ - cgconfigparser should accept empty config file
+ - rename the service
+
+Backported these 3 pacthes:
+
+commit 7155cc27430619be5ffcf1ddc2b6bd8cf7d6d7e0
+Author: Dhaval Giani <dhaval.giani@gmail.com>
+Date:   Fri May 27 10:36:19 2011 +0200
+
+    cgconfig: Do not touch subsystems not mounted by cgconfig
+    
+    cgconfig: Do not touch subsystems not mounted by cgconfig
+    
+    In its failure path, cgconfig should only touch the subsystems
+    it had something to do with. Currently, it unmounts all the
+    subsystems in the config file. Correct this.
+    
+    Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
+    Signed-off-by: Jan Safranek <jsafrane@redhat.com>
+
+commit 431587f4e21b36a3f08bc595d716a70d70314e70
+Author: Jan Safranek <jsafrane@redhat.com>
+Date:   Fri May 20 15:53:05 2011 +0200
+
+    Updated cgconfig service descriptions
+    
+    Signed-off-by: Jan Safranek <jsafrane@redhat.com>
+
+commit 74e1b1e3d04c2f7999e367a20bf73396b61f9b64
+Author: Jan Safranek <jsafrane@redhat.com>
+Date:   Fri May 20 15:52:58 2011 +0200
+
+    Fixed cgconfigparser to allow configs with no 'mount' section
+    
+    cgconfig service fails when something else mounts cgroup hierarchies during
+    boot (e.g. systemd). Therefore we should allow cgconfig.conf to have no
+    'mount' section -> it's up to admin to ensure that controllers are mounted as
+    needed.
+    
+    Because 'group' section is already optional, with this patch cgconfigparser
+    will accept empty configuration file. This is probably the best default
+    config for distros with systemd.
+    
+    Changelog:
+      - fixed case with empty config file and no mounted controllers
+      - reworked the if conditions to be more clear
+    
+    Signed-off-by: Jan Safranek <jsafrane@redhat.com>
+
+diff -up libcgroup-0.37.1/doc/man/cgconfig.conf.5.systemd2 libcgroup-0.37.1/doc/man/cgconfig.conf.5
+--- libcgroup-0.37.1/doc/man/cgconfig.conf.5.systemd2  2011-03-03 09:29:41.000000000 +0100
++++ libcgroup-0.37.1/doc/man/cgconfig.conf.5   2011-05-30 15:06:45.083249011 +0200
+@@ -12,8 +12,8 @@ The file consists of
+ .I mount
+ and
+ .I group
+-sections. These sections can be in arbitrary order. Any line starting with
+-'#' is considered as a comment line and is ignored.
++sections. These sections can be in arbitrary order and both are optional.
++Any line starting with '#' is considered as a comment line and is ignored.
+ .LP
+ .I mount
+ section has this form:
+@@ -50,6 +50,11 @@ controller, shall be mounted. The direct
+ automatically on cgconfig service startup if it does not exist and
+ is deleted on service shutdown.
+ .LP
++
++If no
++.I mount
++section is specified, no controllers are mounted.
++
+ .I group
+ section has this form:
+ .RS
+@@ -171,6 +176,10 @@ created. Optionally it can be enclosed i
+ contain spaces then.
+ .RE
++If no
++.I group
++section is specified, no groups are created.
++
+ .\"********************************************"
+ .SH EXAMPLES
+ .LP
+diff -up libcgroup-0.37.1/scripts/init.d/cgconfig.in.systemd2 libcgroup-0.37.1/scripts/init.d/cgconfig.in
+--- libcgroup-0.37.1/scripts/init.d/cgconfig.in.systemd2       2011-05-30 15:00:36.269947252 +0200
++++ libcgroup-0.37.1/scripts/init.d/cgconfig.in        2011-05-30 15:00:36.284946695 +0200
+@@ -25,8 +25,8 @@
+ # Required-Stop:
+ # Should-Start:
+ # Should-Stop:
+-# Short-Description:    start and stop the WLM configuration
+-# Description:          This script allows us to create a default configuration
++# Short-Description:    Create and setup control group filesystem(s)
++# Description:          Create and setup control group filesystem(s)
+ ### END INIT INFO
+ # get correct location of binaries from configure
+diff -up libcgroup-0.37.1/src/config.c.systemd2 libcgroup-0.37.1/src/config.c
+--- libcgroup-0.37.1/src/config.c.systemd2     2011-03-03 09:29:41.000000000 +0100
++++ libcgroup-0.37.1/src/config.c      2011-05-30 15:17:08.317101247 +0200
+@@ -394,6 +394,7 @@ static int cgroup_config_mount_fs(void)
+       int ret;
+       struct stat buff;
+       int i;
++      int error;
+       for (i = 0; i < config_table_index; i++) {
+               struct cg_mount_table_s *curr = &(config_mount_table[i]);
+@@ -402,26 +403,39 @@ static int cgroup_config_mount_fs(void)
+               if (ret < 0 && errno != ENOENT) {
+                       last_errno = errno;
+-                      return ECGOTHER;
++                      error = ECGOTHER;
++                      goto out_err;
+               }
+               if (errno == ENOENT) {
+                       ret = cg_mkdir_p(curr->path);
+-                      if (ret)
+-                              return ret;
++                      if (ret) {
++                              error = ret;
++                              goto out_err;
++                      }
+               } else if (!S_ISDIR(buff.st_mode)) {
+                       errno = ENOTDIR;
+                       last_errno = errno;
+-                      return ECGOTHER;
++                      error = ECGOTHER;
++                      goto out_err;
+               }
+               ret = mount(CGROUP_FILESYSTEM, curr->path, CGROUP_FILESYSTEM,
+                                                               0, curr->name);
+-              if (ret < 0)
+-                      return ECGMOUNTFAIL;
++              if (ret < 0) {
++                      error = ECGMOUNTFAIL;
++                      goto out_err;
++              }
+       }
+       return 0;
++out_err:
++      /*
++       * If we come here, we have failed. Since we have touched only
++       * mountpoints prior to i, we shall operate on only them now.
++       */
++      config_table_index = 1;
++      return error;
+ }
+ /*
+@@ -681,24 +695,25 @@ int cgroup_config_load_config(const char
+       mount_enabled = (config_mount_table[0].name[0] != '\0');
+       /*
+-       * The configuration should have either namespace or mount.
+-       * Not both and not none.
++       * The configuration should have namespace or mount, not both.
+        */
+-      if (namespace_enabled == mount_enabled) {
++      if (namespace_enabled && mount_enabled) {
+               free(config_cgroup_table);
+               return ECGMOUNTNAMESPACE;
+       }
+-      /*
+-       * We do not allow both mount and namespace sections in the
+-       * same configuration file. So test for that
+-       */
+-
+       error = cgroup_config_mount_fs();
+       if (error)
+               goto err_mnt;
+       error = cgroup_init();
++      if (error == ECGROUPNOTMOUNTED && cgroup_table_index == 0) {
++              /*
++               * The config file seems to be empty.
++               */
++              error = 0;
++              goto err_mnt;
++      }
+       if (error)
+               goto err_mnt;
index 7412ceca142f5a95857a5a32292a5e6cd7bba0c9..2755fdd7234248b1bf0140985d79db572a1554e9 100644 (file)
@@ -2,7 +2,7 @@ Summary:        Tools and library to control and monitor control groups
 Summary(pl.UTF-8):     Narzędzia i biblioteka do kontrolowania i monitorowania grup kontroli
 Name:          libcgroup
 Version:       0.37.1
-Release:       2
+Release:       3
 License:       LGPL v2+
 Group:         Libraries
 Source0:       http://downloads.sourceforge.net/libcg/%{name}-%{version}.tar.bz2
@@ -12,6 +12,8 @@ Source2:      cgred.init
 Patch0:                %{name}-pam.patch
 Patch1:                %{name}-group-write.patch
 Patch2:                %{name}-conf.patch
+Patch3:                libcgroup-0.36.2-systemd.patch
+Patch4:                libcgroup-0.37.1-systemd.patch
 URL:           http://libcg.sourceforge.net/
 BuildRequires: autoconf
 BuildRequires: automake
@@ -78,6 +80,8 @@ Moduł PAM dla libcgroup.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
+%patch4 -p1
 
 %build
 %{__libtoolize}
This page took 0.063962 seconds and 4 git commands to generate.