From 3d3b0e4c271dc30cef1f8b982099a9ca7b0c2232 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Mon, 13 Dec 2010 14:18:54 +0100 Subject: [PATCH] Update to 0.37 --- .gitignore | 1 + fedora-config.patch | 14 ++-- libcgroup-0.36.2-initscripts.patch | 123 ----------------------------- libcgroup.spec | 28 ++++--- sources | 2 +- 5 files changed, 28 insertions(+), 140 deletions(-) delete mode 100644 libcgroup-0.36.2-initscripts.patch diff --git a/.gitignore b/.gitignore index 11104ef..34c21c6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ libcgroup-0.36.2.tar.bz2 +/libcgroup-0.37.tar.bz2 diff --git a/fedora-config.patch b/fedora-config.patch index f8c8f58..940c642 100644 --- a/fedora-config.patch +++ b/fedora-config.patch @@ -47,13 +47,13 @@ diff -up libcgroup-0.34/samples/cgconfig.conf.orig libcgroup-0.34/samples/cgconf +# By default, mount all controllers to /cgroup/ + +mount { -+ cpuset = /cgroup/cpuset; -+ cpu = /cgroup/cpu; -+ cpuacct = /cgroup/cpuacct; -+ memory = /cgroup/memory; -+ devices = /cgroup/devices; -+ freezer = /cgroup/freezer; -+ net_cls = /cgroup/net_cls; ++ cpuset = /sys/fs/cgroup/cpuset; ++ cpu = /sys/fs/cgroup/cpu; ++ cpuacct = /sys/fs/cgroup/cpuacct; ++ memory = /sys/fs/cgroup/memory; ++ devices = /sys/fs/cgroup/devices; ++ freezer = /sys/fs/cgroup/freezer; ++ net_cls = /sys/fs/cgroup/net_cls; +} + diff -up libcgroup-0.35.1/samples/cgconfig.sysconfig.orig libcgroup-0.35.1/samples/cgconfig.sysconfig diff --git a/libcgroup-0.36.2-initscripts.patch b/libcgroup-0.36.2-initscripts.patch deleted file mode 100644 index 99ef8ac..0000000 --- a/libcgroup-0.36.2-initscripts.patch +++ /dev/null @@ -1,123 +0,0 @@ -Bug 619091 - cgconfig service is always reported as "running" - -commit 023fee998f07499938830a044845eb03b816eea7 -Author: Ivana Hutarova Varekova -Date: Wed Jul 14 14:30:48 2010 +0200 - - Init scripts patch - - This patch fixes the return values to meet the standarts. - - changed values are: - cgconfig: - * start action: 6: program is not configured - * status action: 3: program is not running - - cgred: - * start action: 7: program is not running - * start action: 6: program is not configured - * status action: 3: program is not running - * status action: 2: program is dead and /var/run pid file exists - * stop action: 0: if the service is not running - - Signed-off-by: Ivana Hutarova Varekova - Signed-off-by: Dhaval Giani - -diff --git a/scripts/init.d/cgconfig.in b/scripts/init.d/cgconfig.in -index 9cf2c9a..d716b40 100644 ---- a/scripts/init.d/cgconfig.in -+++ b/scripts/init.d/cgconfig.in -@@ -112,6 +112,12 @@ start() { - - if [ $? -eq 0 ] - then -+ if [ ! -s $CONFIG_FILE ] -+ then -+ log_failure_msg $CONFIG_FILE "is not configured" -+ return 6 -+ fi -+ - $CGCONFIGPARSER_BIN -l $CONFIG_FILE - retval=$? - if [ $retval -ne 0 ] -@@ -193,8 +199,10 @@ case $1 in - 'status') - if [ -f /var/lock/subsys/$servicename ] ; then - echo "Running" -+ exit 0 - else - echo "Stopped" -+ exit 3 - fi - ;; - *) -diff --git a/scripts/init.d/cgred.in b/scripts/init.d/cgred.in -index db9c2ac..c5b0ed5 100644 ---- a/scripts/init.d/cgred.in -+++ b/scripts/init.d/cgred.in -@@ -34,6 +34,7 @@ - - prefix=@prefix@;exec_prefix=@exec_prefix@;sbindir=@sbindir@ - CGRED_BIN=$sbindir/cgrulesengd -+CGRED_CONF=/etc/cgrules.conf - - # Sanity checks - [ -x $CGRED_BIN ] || exit 1 -@@ -62,14 +63,21 @@ RETVAL=0 - - start() - { -- echo $"Starting CGroup Rules Engine Daemon..." -+ echo -n $"Starting CGroup Rules Engine Daemon: " - if [ -f "/var/lock/subsys/$servicename" ] ; then - log_failure_msg "$servicename is already running with PID `cat ${pidfile}`" -- return 1 -+ return 0 -+ fi -+ if [ ! -s $CGRED_CONF ]; then -+ log_failure_msg "not configured" -+ return 6 - fi - daemon --check $servicename --pidfile $pidfile $CGRED_BIN $OPTIONS - RETVAL=$? - echo -+ if [ $RETVAL -ne 0 ]; then -+ return 7 -+ fi - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename - echo "`pidof $processname`" > $pidfile - } -@@ -77,6 +85,10 @@ start() - stop() - { - echo -n $"Stopping CGroup Rules Engine Daemon..." -+ if [ ! -f $pidfile ]; then -+ log_success_msg -+ return 0 -+ fi - killproc -p $pidfile $processname -TERM - RETVAL=$? - echo -@@ -84,19 +96,20 @@ stop() - rm -f /var/lock/subsys/$servicename - rm -f $pidfile - fi -- log_success_msg - } - - # See how we are called - case "$1" in - start) - start -+ RETVAL=$? - ;; - stop) - stop -+ RETVAL=$? - ;; - status) -- status -p $pidfile $processname -+ status -p $pidfile $servicename - RETVAL=$? - ;; - restart) diff --git a/libcgroup.spec b/libcgroup.spec index a7cfb2d..ea26db6 100644 --- a/libcgroup.spec +++ b/libcgroup.spec @@ -1,24 +1,24 @@ -%define soversion 1.0.36 +%define soversion 1.0.37 %define soversion_major 1 Name: libcgroup Summary: Tools and libraries to control and monitor control groups Group: Development/Libraries -Version: 0.36.2 -Release: 3%{?dist} +Version: 0.37 +Release: 1%{?dist} License: LGPLv2+ URL: http://libcg.sourceforge.net/ Source0: http://downloads.sourceforge.net/libcg/%{name}-%{version}.tar.bz2 Source1: README.Fedora Patch1: fedora-config.patch Patch2: fedora-fix-initscripts.patch -Patch3: libcgroup-0.36.2-initscripts.patch -Patch4: libcgroup-0.36.2-systemd.patch +Patch3: libcgroup-0.36.2-systemd.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: pam-devel BuildRequires: byacc BuildRequires: flex BuildRequires: coreutils +Requires(pre): shadow-utils Requires(post): chkconfig, /sbin/service Requires(preun): /sbin/chkconfig @@ -49,8 +49,7 @@ provide scripts to manage that configuration. %setup -q %patch1 -p1 -b .config %patch2 -p1 -b .lsb -%patch3 -p1 -b .running -%patch4 -p1 -b .systemd +%patch3 -p1 -b .systemd %build %configure --bindir=/bin --sbindir=/sbin --libdir=%{_libdir} --enable-initscript-install --enable-pam-module-dir=/%{_lib}/security @@ -68,6 +67,7 @@ cp samples/cgred.conf $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/cgred.conf cp samples/cgconfig.sysconfig $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/cgconfig cp samples/cgconfig.conf $RPM_BUILD_ROOT/%{_sysconfdir}/cgconfig.conf cp samples/cgrules.conf $RPM_BUILD_ROOT/%{_sysconfdir}/cgrules.conf +cp samples/cgsnapshot_blacklist.conf $RPM_BUILD_ROOT/%{_sysconfdir}/cgsnapshot_blacklist.conf # sanitize pam module, we need only pam_cgroup.so mv -f $RPM_BUILD_ROOT/%{_lib}/security/pam_cgroup.so.*.*.* $RPM_BUILD_ROOT/%{_lib}/security/pam_cgroup.so @@ -90,6 +90,8 @@ cp %SOURCE1 . %clean rm -rf $RPM_BUILD_ROOT +%pre +getent group cgred >/dev/null || groupadd cgred %post /sbin/ldconfig @@ -112,8 +114,9 @@ fi %config(noreplace) %{_sysconfdir}/sysconfig/cgconfig %config(noreplace) %{_sysconfdir}/cgconfig.conf %config(noreplace) %{_sysconfdir}/cgrules.conf +%config(noreplace) %{_sysconfdir}/cgsnapshot_blacklist.conf /%{_lib}/libcgroup.so.* -/bin/cgexec +%attr(2755, root, cgred) /bin/cgexec /bin/cgclassify /bin/cgcreate /bin/cgget @@ -124,6 +127,7 @@ fi /sbin/cgconfigparser /sbin/cgrulesengd /sbin/cgclear +/bin/cgsnapshot %attr(0644, root, root) %{_mandir}/man1/* %attr(0644, root, root) %{_mandir}/man5/* %attr(0644, root, root) %{_mandir}/man8/* @@ -135,16 +139,22 @@ fi %files pam %defattr(-,root,root,-) %attr(0755,root,root) /%{_lib}/security/pam_cgroup.so +%doc COPYING INSTALL %files devel %defattr(-,root,root,-) %{_includedir}/libcgroup.h %{_includedir}/libcgroup/*.h %{_libdir}/libcgroup.* -%{_libdir}/pkgconfig/libcgroup.pc +/%{_libdir}/pkgconfig/libcgroup.pc %doc COPYING INSTALL %changelog +* Mon Dec 13 2010 Jan Safranek +- Update to 0.37 +- use /sys/fs/cgroup as default directory to mount control groups (and rely on + systemd mounting tmpfs there) + * Fri Nov 12 2010 Jan Safranek 0.36.2-3 - Ignore systemd hierarchy - it's now invisible to libcgroup (#627378) diff --git a/sources b/sources index dad6782..a2530a0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2b0fedf37e8f3e915a2f4f3f10879076 libcgroup-0.36.2.tar.bz2 +beecca8770155afa62981076e96d4c9c libcgroup-0.37.tar.bz2