From 423018f381695df07245c5e9dbe9fd793d8bdff6 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Mon, 17 Jan 2011 10:54:19 +0100 Subject: [PATCH] Create the 'cgred' group as system group, not as user Fix cgclassify exit code --- libcgrouop-0.37-cgclassify.patch | 27 +++++++++++++++++++++++++++ libcgroup.spec | 12 +++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 libcgrouop-0.37-cgclassify.patch diff --git a/libcgrouop-0.37-cgclassify.patch b/libcgrouop-0.37-cgclassify.patch new file mode 100644 index 0000000..61a8449 --- /dev/null +++ b/libcgrouop-0.37-cgclassify.patch @@ -0,0 +1,27 @@ +commit 1d7bbecfea73bd0b21c457c240e9049f8a5c40cc +Author: Jan Safranek +Date: Fri Jan 7 13:29:04 2011 +0100 + + BUGFIX: add missing braces + + Fix cgclassify to return zero exit code when it succeeds. + + Signed-off-by: Jan Safranek + +diff --git a/src/tools/cgclassify.c b/src/tools/cgclassify.c +index 3181105..fcad4b2 100644 +--- a/src/tools/cgclassify.c ++++ b/src/tools/cgclassify.c +@@ -45,10 +45,11 @@ static int change_group_path(pid_t pid, struct cgroup_group_spec *cgroup_list[]) + + ret = cgroup_change_cgroup_path(cgroup_list[i]->path, pid, + (const char*const*) cgroup_list[i]->controllers); +- if (ret) ++ if (ret) { + fprintf(stderr, "Error changing group of pid %d: %s\n", + pid, cgroup_strerror(ret)); + return -1; ++ } + } + + return 0; diff --git a/libcgroup.spec b/libcgroup.spec index ea26db6..4e25547 100644 --- a/libcgroup.spec +++ b/libcgroup.spec @@ -5,7 +5,7 @@ Name: libcgroup Summary: Tools and libraries to control and monitor control groups Group: Development/Libraries Version: 0.37 -Release: 1%{?dist} +Release: 2%{?dist} License: LGPLv2+ URL: http://libcg.sourceforge.net/ Source0: http://downloads.sourceforge.net/libcg/%{name}-%{version}.tar.bz2 @@ -13,6 +13,7 @@ Source1: README.Fedora Patch1: fedora-config.patch Patch2: fedora-fix-initscripts.patch Patch3: libcgroup-0.36.2-systemd.patch +Patch4: libcgrouop-0.37-cgclassify.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: pam-devel BuildRequires: byacc @@ -50,6 +51,7 @@ provide scripts to manage that configuration. %patch1 -p1 -b .config %patch2 -p1 -b .lsb %patch3 -p1 -b .systemd +%patch4 -p1 -b .cgclassify %build %configure --bindir=/bin --sbindir=/sbin --libdir=%{_libdir} --enable-initscript-install --enable-pam-module-dir=/%{_lib}/security @@ -91,7 +93,7 @@ cp %SOURCE1 . rm -rf $RPM_BUILD_ROOT %pre -getent group cgred >/dev/null || groupadd cgred +getent group cgred >/dev/null || groupadd -r cgred %post /sbin/ldconfig @@ -150,7 +152,11 @@ fi %doc COPYING INSTALL %changelog -* Mon Dec 13 2010 Jan Safranek +* Mon Jan 17 2011 Jan Safranek 0.37-2 +- Create the 'cgred' group as system group, not as user +- Fix cgclassify exit code + +* Mon Dec 13 2010 Jan Safranek 0.37-1 - Update to 0.37 - use /sys/fs/cgroup as default directory to mount control groups (and rely on systemd mounting tmpfs there)