packages: libcgroup/libcgroup.spec, libcgroup/libcgroup-0.36.2-systemd.patc...
arekm
arekm at pld-linux.org
Sun Jan 29 11:57:47 CET 2012
Author: arekm Date: Sun Jan 29 10:57:47 2012 GMT
Module: packages Tag: HEAD
---- Log message:
- rel 3; systemd patches from fc
---- Files affected:
packages/libcgroup:
libcgroup.spec (1.23 -> 1.24) , libcgroup-0.36.2-systemd.patch (NONE -> 1.1) (NEW), libcgroup-0.37.1-systemd.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/libcgroup/libcgroup.spec
diff -u packages/libcgroup/libcgroup.spec:1.23 packages/libcgroup/libcgroup.spec:1.24
--- packages/libcgroup/libcgroup.spec:1.23 Tue Apr 5 22:41:51 2011
+++ packages/libcgroup/libcgroup.spec Sun Jan 29 11:57:42 2012
@@ -3,7 +3,7 @@
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
@@ -13,6 +13,8 @@
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
@@ -79,6 +81,8 @@
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
+%patch4 -p1
%build
%{__libtoolize}
@@ -187,6 +191,9 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.24 2012/01/29 10:57:42 arekm
+- rel 3; systemd patches from fc
+
Revision 1.23 2011/04/05 20:41:51 arekm
- rel 2
================================================================
Index: packages/libcgroup/libcgroup-0.36.2-systemd.patch
diff -u /dev/null packages/libcgroup/libcgroup-0.36.2-systemd.patch:1.1
--- /dev/null Sun Jan 29 11:57:47 2012
+++ packages/libcgroup/libcgroup-0.36.2-systemd.patch Sun Jan 29 11:57:42 2012
@@ -0,0 +1,24 @@
+Ignore systemd hierarchy. Quick&dirity fix for bug #627378
+
+Author: Dhaval Giani <dhaval.bugzilla at 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) {
================================================================
Index: packages/libcgroup/libcgroup-0.37.1-systemd.patch
diff -u /dev/null packages/libcgroup/libcgroup-0.37.1-systemd.patch:1.1
--- /dev/null Sun Jan 29 11:57:47 2012
+++ packages/libcgroup/libcgroup-0.37.1-systemd.patch Sun Jan 29 11:57:42 2012
@@ -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 at 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 at gmail.com>
+ Signed-off-by: Jan Safranek <jsafrane at redhat.com>
+
+commit 431587f4e21b36a3f08bc595d716a70d70314e70
+Author: Jan Safranek <jsafrane at redhat.com>
+Date: Fri May 20 15:53:05 2011 +0200
+
+ Updated cgconfig service descriptions
+
+ Signed-off-by: Jan Safranek <jsafrane at redhat.com>
+
+commit 74e1b1e3d04c2f7999e367a20bf73396b61f9b64
+Author: Jan Safranek <jsafrane at 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 at 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;
+
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/libcgroup/libcgroup.spec?r1=1.23&r2=1.24&f=u
More information about the pld-cvs-commit
mailing list