Package Details: libcgroup 2.0-1

Git Clone URL: https://aur.archlinux.org/libcgroup.git (read-only, click to copy)
Package Base: libcgroup
Description: Library that abstracts the control group file system in Linux
Upstream URL: https://github.com/libcgroup/libcgroup
Licenses: LGPL
Submitter: heftig
Maintainer: eworm
Last Packager: eworm
Votes: 116
Popularity: 1.43
First Submitted: 2010-04-25 12:01 (UTC)
Last Updated: 2021-05-10 10:42 (UTC)

Latest Comments

bar777 commented on 2021-06-23 08:55 (UTC)

PGP signature failed!

pxeger commented on 2021-05-16 13:55 (UTC)

libcgroup-2.0.tar.bz2 is failing its PGP signature check.

pierrec commented on 2021-04-16 13:10 (UTC)

Hi, I've just created a libcgroup-git package as an alternative. It supports cgroup-v2

zyeri commented on 2019-11-15 03:18 (UTC)

libcgroup-0.41.tar.bz2 is failing its sha256 check.

appleby commented on 2019-02-22 02:27 (UTC)

The cgrules service is failing to start for me on reboot once it's been enabled. The error in the systemctl status cgrules.service log is:

cgrulesengd[399]: Error binding UNIX socket /var/run/cgred.socket: No such file or directory

It seems the problem is that I have /var on a separate partition, and the /var filesystem is not mounted at the time the cgrules service runs. This is because the cgrules.service unit file specifies DefaultDependencies=no and Before=basic.target, but basic.target is the target that mounts /var.

Note that /var/run is symlinked to /run on Arch, and /run is apparently mounted very early in the boot process, so the simplest fix is to pass --enable-cgred-socket=/run/cgred.socket to the configure script. The following patch worked for me:

diff -x '*.xz' -u libcgroup/PKGBUILD libcgroup.new/PKGBUILD
--- libcgroup/PKGBUILD  2015-06-30 06:39:06.000000000 -0500
+++ libcgroup.new/PKGBUILD      2019-02-21 15:49:02.660230586 -0600
@@ -28,6 +28,7 @@
                --sysconfdir=/etc \
                --localstatedir=/var \
                --sbindir=/usr/bin \
+               --enable-cgred-socket=/run/cgred.socket \
                --enable-opaque-hierarchy=name=systemd

        make

Alternatively, if you're ok with running cgrules.service after basic.target, the following patch also works. The idea is to just let systemd add a default dependency on sysinit.target and an After=basic.target, which ensures that /var is mounted by the time cgrules.service runs. It might also make sense to apply a similar change to cgconfig.service, but that is not required.

https://www.freedesktop.org/software/systemd/man/systemd.service.html#Default%20Dependencies

diff -x '*.xz' -u libcgroup/cgrules.service libcgroup.new/cgrules.service
--- libcgroup/cgrules.service   2015-06-30 06:39:06.000000000 -0500
+++ libcgroup.new/cgrules.service   2019-02-21 13:11:17.682489779 -0600
@@ -1,11 +1,6 @@
 [Unit]
 Description=Control Group rules service

-# The service should be able to start as soon as possible,
-# before any 'normal' services:
-DefaultDependencies=no
-Conflicts=shutdown.target
-Before=basic.target shutdown.target
 After=cgconfig.service

 [Service]
diff -x '*.xz' -u libcgroup/PKGBUILD libcgroup.new/PKGBUILD
--- libcgroup/PKGBUILD  2015-06-30 06:39:06.000000000 -0500
+++ libcgroup.new/PKGBUILD  2019-02-21 14:23:46.900014839 -0600
@@ -18,7 +18,7 @@
    'cgrules.service')
 sha256sums=('e4e38bdc7ef70645ce33740ddcca051248d56b53283c0dc6d404e17706f6fb51'
             '808fc354abf36d7b6673dad790be275309ac57a2606d1be3732b9b3aeb5885eb'
-            '6b1340ff6717f55e5e57dacc72accc0bfaed7e50ef31439271b6ddc893cbf671')
+            '1186ecb5647b26788edcd0b9e782ae6fa783399547773363818e07c21cbbabbf')

 build() {
    cd "${srcdir}/${pkgname}-${pkgver/rc/.rc}"

wdkrnls commented on 2018-11-25 20:15 (UTC)

I'm seeing the following error on install (using yaourt -S):

groupadd: cannot open /etc/gshadow
groupadd: failed to unlock /etc/gshadow
error: command failed to execute correctly
:: Running post-transaction hooks...
(1/3) Reloading system manager configuration...
(2/3) Arming ConditionNeedsUpdate...
(3/3) etckeeper: post-transaction commit
No database errors have been found!

zzbutcher commented on 2018-03-21 06:35 (UTC)

hi,cgroup do not working.why?

cgconfig.conf: mount { cpu = /cgroup/cpu }

● cgconfig.service - Control Group configuration service Loaded: loaded (/usr/lib/systemd/system/cgconfig.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since Wed 2018-03-21 06:33:52 UTC; 5s ago Process: 12761 ExecStop=/usr/sbin/cgclear -l /etc/cgconfig.conf -L /etc/cgconfig.d -e (code=exited, status=0/SUCCESS) Process: 12794 ExecStart=/usr/sbin/cgconfigparser -l /etc/cgconfig.conf -L /etc/cgconfig.d -s 1664 (code=exited, status=101) Main PID: 12794 (code=exited, status=101)

Mar 21 06:33:52 ip-172-31-25-183.us-east-2.compute.internal systemd[1]: Starting Control Group configuration service... Mar 21 06:33:52 ip-172-31-25-183.us-east-2.compute.internal systemd[1]: cgconfig.service: main process exited, code=exited, status=101/n/a Mar 21 06:33:52 ip-172-31-25-183.us-east-2.compute.internal systemd[1]: Failed to start Control Group configuration service. Mar 21 06:33:52 ip-172-31-25-183.us-east-2.compute.internal cgconfigparser[12794]: /usr/sbin/cgconfigparser; error loading /etc/cgconfig.conf: Cgroup mounting failed Mar 21 06:33:52 ip-172-31-25-183.us-east-2.compute.internal cgconfigparser[12794]: Error: cannot mount cpu to /cgroup/cpu: Permission denied Mar 21 06:33:52 ip-172-31-25-183.us-east-2.compute.internal systemd[1]: Unit cgconfig.service entered failed state. Mar 21 06:33:52 ip-172-31-25-183.us-east-2.compute.internal systemd[1]: cgconfig.service failed.

arno commented on 2014-03-25 19:13 (UTC)

I think it need a cgrules.socket to start correctly. $ diff -U1 cgrules.service{.org,} --- cgrules.service.org 2014-03-25 20:07:42.000000000 +0100 +++ cgrules.service 2014-03-25 20:10:22.000000000 +0100 @@ -2,2 +2,3 @@ Description=Control Group rules service +Requires=cgrules.socket @@ -16 +17,2 @@ WantedBy=sysinit.target +Also=cgrules.socket $ cat cgrules.socket [Unit] Description=Control Group Rules Daemon Listen Socket [Socket] ListenStream=/var/run/cgred.socket [Install] WantedBy=sockets.target

eworm commented on 2014-02-20 10:50 (UTC)

flex and bison belong to base-devel and are expected to be installed.

Hrafnahnef commented on 2014-02-20 10:49 (UTC)

Please add makedepends=('flex' 'bison') to the PKGBUILD.

kjslag commented on 2014-01-28 08:54 (UTC)

flex seems to to be a necessary make dependency

eworm commented on 2013-05-13 07:38 (UTC)

You should try to get your changes upstream. ;) PKGBUILD is updated, have fun!

mamciek commented on 2013-05-13 07:05 (UTC)

please update cgrules.service. New revision of it is available here: https://gist.github.com/mamciek/5539646 Current revision contains an error.

mamciek commented on 2013-05-08 10:34 (UTC)

Please include systemd service to start cgrulesengd. I have created one here: https://gist.github.com/mamciek/5539646

supersym commented on 2013-04-02 17:19 (UTC)

@eworm: works great here! Thanks :) Now I can rid myself of some more system messages that have been bugging me.

eworm commented on 2013-01-16 09:14 (UTC)

Updated the package and added systemd service file. Can anybody please test?

big_gie commented on 2013-01-15 19:19 (UTC)

Here's a patch to enable systemd: --- PKGBUILD.orig 2013-01-15 13:19:42.775620213 -0500 +++ PKGBUILD 2013-01-15 14:18:12.882960578 -0500 @@ -12,7 +12,7 @@ options=('!emptydirs' '!libtool') install=libcgroup.install source=("http://downloads.sourceforge.net/libcg/${pkgname}-${pkgver/rc/.rc}.tar.bz2" - 'cgred' 'cgconfig' 'cgconfig.conf') + 'cgred' 'cgconfig' 'cgconfig.conf' 'cgconfig.service') build() { cd "${srcdir}/${pkgname}-${pkgver/rc/.rc}" @@ -20,7 +20,8 @@ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ - --localstatedir=/var + --localstatedir=/var \ + --enable-opaque-hierarchy=name=systemd make } @@ -34,6 +35,7 @@ install -Dm644 samples/cgconfig.conf "${pkgdir}/etc/cgconfig.conf" install -Dm644 samples/cgrules.conf "${pkgdir}/etc/cgrules.conf" install -Dm644 samples/cgsnapshot_blacklist.conf "${pkgdir}/etc/cgsnapshot_blacklist.conf" + install -Dm644 cgconfig.service "${pkgdir}/usr/lib/systemd/system/cgconfig.service" rm -f ${pkgdir}/usr/lib/security/pam_cgroup.{la,so,so.0} mv ${pkgdir}/usr/lib/security/pam_cgroup.so.0.0.0 ${pkgdir}/usr/lib/security/pam_cgroup.so @@ -51,4 +53,5 @@ sha256sums=('9d27e4b16b92fb9917d0807934023b8cc691f3b5258c4ee581957645fa7ba143' 'f68aadcacca0bbc22b9b89e1f2d9a1d607d1a39890d444eeef7b5574beda138d' '40fa009e4beb576728eaab7165e824826cbed46e534e3a25503c6b9d7ed5f640' - '72c39ce0160c30d714f1a7187036757bf9a8c8649f0818404e3bc45f4ae76e6b') + '72c39ce0160c30d714f1a7187036757bf9a8c8649f0818404e3bc45f4ae76e6b' + '3bdaadce18a482d8e42590aefa9bdd78407a67dd8860377e07d0e69242de2aca') Note the required "cgconfig.service" file, downloaded from http://libcg.git.sourceforge.net/git/gitweb.cgi?p=libcg/libcg;a=blob;f=dist/cgconfig.service;hb=HEAD Note also that the file "cgconfig.service" must use /usr/sbin/{cgconfigparser,cgclear} instead of plain /sbin.

sacarde commented on 2012-12-29 08:12 (UTC)

https://bbs.archlinux.org/viewtopic.php?id=154950

sacarde commented on 2012-12-22 16:01 (UTC)

hi, what I have to do for limit memory use by a process? - cgroups ? - cgroups guide in wiki is uptodate? - I have to install libcgroup ? thanks for your suggestions

eworm commented on 2012-08-26 20:04 (UTC)

I think I will wait for 0.39 final. Should be around the corner as there is already a rc.

t-8ch commented on 2012-08-26 11:49 (UTC)

Upstream added a cgconfig.service unit file for systemd after 0.38 which could be backportet. [1] There is also a special switch to ./configure '--enable-opaque-hierarchy=name=systemd' as explained in [1]. This make libcgroup ignore the cgroups of systemd. [0] http://libcg.git.sourceforge.net/git/gitweb.cgi?p=libcg/libcg;a=blob;f=dist/cgconfig.service;h=e63f26dcd5c63a7644aeef211d577db29f5515ed;hb=HEAD [1] http://libcg.git.sourceforge.net/git/gitweb.cgi?p=libcg/libcg;a=blob;f=README_systemd;h=6733c2c49d6aadaa7f12c912dcaa50e21911a700;hb=HEAD

eworm commented on 2012-08-17 20:34 (UTC)

0.39-rc1 is not a final but rc release. Any good reason to upgrade instead of just unflagging?

commented on 2012-08-17 15:42 (UTC)

There is a damn good case for including this under stable, as those utilities are pretty standard on every distro and cgroups is a core functionality of the Linux kernel.

divansantana commented on 2012-07-08 19:19 (UTC)

Unfortunately the init scripts don't seem to work. :: Starting CGroups configuration [BUSY] /etc/rc.d/cgconfig: line 15: [: =: unary operator expected :: Starting CGroups rules engine daemon [BUSY] /etc/rc.d/cgred: line 26: /sbin/cgrulesengd: No such file or directory [FAIL] sudo rc.d stop cgconfig :: Clearing CGroups configuration [BUSY] cgclear failed with No such process [FAIL]

eworm commented on 2012-05-22 09:52 (UTC)

I do not use the init script myself... Can you please update to 0.38-3 and test?

kylef commented on 2012-05-22 09:00 (UTC)

There seems to be some issue with the cgconfig rc.d script. % sudo rc.d start cgconfig :: Starting CGroups configuration [BUSY] /etc/rc.d/cgconfig: line 15: [: too many arguments

eworm commented on 2012-05-11 21:24 (UTC)

Sure. Updated...

smoge commented on 2012-05-11 17:34 (UTC)

`/etc/rc.d/cgconfig: line 68: /sbin/cgconfigparser: No such file or directory` It should be `/usr/sbin/cgconfigparser` right?

shomodj commented on 2012-04-26 11:47 (UTC)

v.038 2012-02-20

commented on 2012-02-11 03:27 (UTC)

michaelneale; You need to add those options manually to the cgconfig.conf file. mount { cpu = /mnt/cgroups/cpu; cpuacct = /mnt/cgroups/cpuacct; blkio = /mnt/cgroups/blkio; memory = /mnt/cgroups/memory; cpuset = /mnt/cgroups/cpuset; freezer = /mnt/cgroups/freezer; devices = /mnt/cgroups/devices; net_cls = /mnt/cgroups/net_cls; }

commented on 2011-03-01 06:38 (UTC)

I am not sure if it is the libcgroup version linked above, or the kernel I am using - but there seems to be no blkio or net/io tunable for this - only cpu and memory? For example http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Resource_Management_Guide/ch-Subsystems_and_Tunable_Parameters.html#sec-blkio - that doesn't seem to be available. According to my sources patches like this http://lwn.net/Articles/265944/ have been in since 2.6.25.

commented on 2010-12-24 23:55 (UTC)

http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Resource_Management_Guide/index.html It is manual about cgroups for RedHat Linux. Some things are usefull, and if Ihad more free time, I`ll try to add info to wiki page. But now just post it here.

heftig commented on 2010-12-12 18:28 (UTC)

Both yacc (bison) and flex are part of the base-devel group and expected to be installed when you use makepkg.

olace commented on 2010-12-12 18:17 (UTC)

Please. put byacc and flex as dependency, thanks.

intgr commented on 2010-09-24 22:38 (UTC)

I wrote a wiki article about basic cgroups usage: http://wiki.archlinux.org/index.php/Cgroups Everyone's invited to improve it!

heftig commented on 2010-04-25 14:07 (UTC)

You can use this package to automatically classify tasks into control groups (e.g. based on uid or gid).