Create the 'cgred' group as system group, not as user

Fix cgclassify exit code
This commit is contained in:
Jan Safranek 2011-01-17 10:54:19 +01:00
parent 3d3b0e4c27
commit 423018f381
2 changed files with 36 additions and 3 deletions

View File

@ -0,0 +1,27 @@
commit 1d7bbecfea73bd0b21c457c240e9049f8a5c40cc
Author: Jan Safranek <jsafrane@redhat.com>
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 <jsafrane@redhat.com>
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;

View File

@ -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 <jsafrane@redhat.com>
* Mon Jan 17 2011 Jan Safranek <jsafrane@redhat.com> 0.37-2
- Create the 'cgred' group as system group, not as user
- Fix cgclassify exit code
* Mon Dec 13 2010 Jan Safranek <jsafrane@redhat.com> 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)