I use libcgroup-openrc-git. It's a fully working package but I didn't know what I could do with it other than use it myself, as it's an openrc Artix package so might not be suitable for the AUR, especially as I don't have a straight Arch install to test it with, and Artix package guidelines say no git packages.
The patch came from their mailing list, they were very helpful. AFAIK (which may not be that far ) it's the best most full featured cgroup manager, and it's not had a release for a few years as cgroup management functionality has been added to systemd leaving other methods as a low priority I suppose. But a lot of useful commits have been added since the last release, so the git version should be better.
Had you also noticed ionice has been broken due to kernel changes? This also breaks btrfs scrub niceness. The recommendation is to use cgroups instead.
Here's the PKGBUILD and associated files (it provides / conflicts with the libcgroup AUR pkg so it won't cause a problem if you had that installed before):
$ cat PKGBUILD
pkgname=libcgroup-openrc-git
pkgver=r920.62f7665
pkgrel=1
pkgdesc='Library that abstracts the control group file system in Linux, configured for OpenRC, GIT version.'
arch=('i686' 'x86_64')
url='http://libcg.sourceforge.net'
license=(LGPL)
makedepends=('git')
provides=('libcgroup')
conflicts=('libcgroup')
backup=('etc/cgconfig.conf'
'etc/cgrules.conf'
'etc/cgsnapshot_blacklist.conf')
options=('!libtool')
install=libcgroup.install
source=("git://git.code.sf.net/p/libcg/libcg" "fix-segfault.patch" "libcgroup")
md5sums=('SKIP' 'SKIP' 'SKIP')
pkgver() {
cd "$srcdir/libcg"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
cd ${srcdir}/libcg
patch --forward --strip=1 --input="${srcdir}/fix-segfault.patch"
#patch --forward --strip=1 --input="fix-segfault.patch"
}
build() {
cd "${srcdir}/libcg"
autoreconf -i
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--sbindir=/usr/bin \
--enable-opaque-hierarchy=name=openrc
make
}
package() {
cd "${srcdir}/libcg"
make DESTDIR="${pkgdir}" pkgconfigdir="/usr/lib/pkgconfig" install
install -D -m0644 samples/cgconfig.conf "${pkgdir}/etc/cgconfig.conf"
install -D -m0644 samples/cgrules.conf "${pkgdir}/etc/cgrules.conf"
install -D -m0644 samples/cgsnapshot_blacklist.conf "${pkgdir}/etc/cgsnapshot_blacklist.conf"
install -D -m0755 ${srcdir}/libcgroup "${pkgdir}/etc/init.d/libcgroup"
install -d -m0755 $pkgdir/etc/cgconfig.d
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
rm -rf ${pkgdir}/etc/rc.d
# Make cgexec setgid cgred
chown root:160 ${pkgdir}/usr/bin/cgexec
chmod 2755 ${pkgdir}/usr/bin/cgexec
#mkdir -p $pkgdir/etc/cgconfig.d
}
$ cat fix-segfault.patch
diff --git a/src/parse.y b/src/parse.y
index 98f7699..e67ad54 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -45,9 +45,9 @@ int yywrap(void)
int val;
struct cgroup_dictionary *values;
}
-%type <name> ID DEFAULT
+%type <name> ID DEFAULT group_name
%type <val> mountvalue_conf mount task_namevalue_conf admin_namevalue_conf
-%type <val> admin_conf task_conf task_or_admin group_conf group start group_name
+%type <val> admin_conf task_conf task_or_admin group_conf group start
%type <val> namespace namespace_conf default default_conf
%type <values> namevalue_conf
%type <val> template template_conf
$ cat libcgroup
#!/usr/bin/openrc-run
name="libcgroup"
description="libcgroup daemon - cgrulesengd"
command="/usr/bin/cgrulesengd"
command_args="-s -g cgred"
start_pre() {
/usr/bin/cgconfigparser -l /etc/cgconfig.conf -s 1664
}
stop_post() {
/usr/bin/cgclear -l /etc/cgconfig.conf -e
}
$ cat libcgroup.install
post_install() {
getent group cgred &>/dev/null || groupadd -r -g 160 cgred >/dev/null
}
post_upgrade() {
post_install
}
post_remove() {
getent group cgred &>/dev/null && groupdel cgred >/dev/null
}