#923449 runit: cgroups support

Package:
runit
Source:
runit
Description:
system-wide service supervision
Submitter:
Dmitry Bogatov
Date:
2026-10-03 18:37:06 UTC
Severity:
wishlist
Tags:
#923449#5
Date:
2019-02-28 12:06:13 UTC
From:
To:
Just a thought. What about adding support of cgroups into invoke-run
script. It could create one cgroup for every service and set configure
its limits from config directory /etc/sv/<service>/cf-conf, for example.

#923449#10
Date:
2019-04-30 15:03:27 UTC
From:
To:
[2019-02-28 12:06] Dmitry Bogatov <KAction@debian.org>

Some experiments had shown following wierd behaviour:

1. create new cgroup without any limits

 # mkdir /sys/fs/cgroups/foobar
 # cd /sys/fs/cgroups/foobar

2. try to put process it it

 # echo $$ > tasks
 bash: echo: write error: No space left on device

3. Now, perform magic I have searched for on web for hour or so:

 # echo 0 | tee cpuset.mems cpuset.cpus
 # echo $$ > tasks

4. Success!

This is workaround I need to keep in mind when implementing cgroup support.

Dear kernel maintainers, is intendend behaviour?

#923449#15
Date:
2026-08-21 22:39:53 UTC
From:
To:
there is a commit in git (next branch) that adds optional support for
cgroup in invoke-run and finish-exec;
cgroup2 is mounted in stage 1 for runit-init.
when the 'cgroup' directory is found and the process is run with
uid=0 then files inside cgroup are copied into
/sys/fs/cgroup/service/svname/ and svname pid is added to the
svname cgroup;
finish-exec, under the same condition of invoke-run (cgroup dir and
uid=0) simply kills every process in the cgroup and then removes it

This needs testing; still TODO: manpage update for invoke-run and
runsv-cg; briefly documenting files inside cgroup would be nice too

#923449#18
Date:
2026-08-21 22:44:16 UTC
From:
To:
Hello,

Bug #923449 in runit reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/debian/runit/-/commit/48450cdc85438c77ee6b830834d9f7b31f4cb534
------------------------------------------------------------------------
invoke-run, finish-exec: add optional cgroup support

* invoke-run:
  when 'cgroup' directory is found in the service directory and uid=0
  run 'runsv-cg create'.
  this will create /sys/fs/cgroup/service/svname directory, then it
  will copy files in cgroup directory to /sys/fs/cgroup/service/svname/
  and finally will add the service pid to
  /sys/fs/cgroup/service/"$sv"/cgroup.procs
* finish-exec:
  when 'cgroup' directory is found in the service directory and uid=0
  run 'runsv-cg destroy'.
  this will kill every process in the cgroup, then it will remove
  the svname cgroup in /sys/fs/cgroup/service/svname.
  For well behaving services, 'runsv-cg remove' could be enough.

Closes: #923449
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/923449

#923449#23
Date:
2026-10-03 18:29:00 UTC
From:
To:
Hello,

Bug #923449 in runit reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/debian/runit/-/commit/48450cdc85438c77ee6b830834d9f7b31f4cb534
------------------------------------------------------------------------
invoke-run, finish-exec: add optional cgroup support

* invoke-run:
  when 'cgroup' directory is found in the service directory and uid=0
  run 'runsv-cg create'.
  this will create /sys/fs/cgroup/service/svname directory, then it
  will copy files in cgroup directory to /sys/fs/cgroup/service/svname/
  and finally will add the service pid to
  /sys/fs/cgroup/service/"$sv"/cgroup.procs
* finish-exec:
  when 'cgroup' directory is found in the service directory and uid=0
  run 'runsv-cg destroy'.
  this will kill every process in the cgroup, then it will remove
  the svname cgroup in /sys/fs/cgroup/service/svname.
  For well behaving services, 'runsv-cg remove' could be enough.

Closes: #923449
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/923449

#923449#28
Date:
2026-10-03 18:35:51 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
runit, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 923449@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Lorenzo Puliti <plorenzo@disroot.org> (supplier of updated runit package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Fri, 02 Oct 2026 16:19:22 +0200
Source: runit
Architecture: source
Version: 2.3.1-5
Distribution: unstable
Urgency: medium
Maintainer: Lorenzo Puliti <plorenzo@disroot.org>
Changed-By: Lorenzo Puliti <plorenzo@disroot.org>
Closes: 923449 1105907 1143778 1144866
Changes:
 runit (2.3.1-5) unstable; urgency=medium
 .
   * default-syslog: silence socklog-check output
   * add runsv-cg for setting up cgroups on runit
   * stage 1: setup (mount) cgroup2
   * add a manpage for runsv-cg
   * runsv-cg:
      - fix typo
      - do not require runit as init
   * use /sys/fs/cgroup/runit for runit's services cgroups
   * invoke-run, finish-exec: add optional cgroup support (Closes: #923449)
   * invoke-run:
      - update manpage for cgroups
      - allow users to control verbosity for user services (Closes: #1143778)
      - clarify home directory for user services in manpage
   * runit-run: fix race at systemd shutdown.
       + thanks to Jan Braun <janbraun@gmx.de> (Closes: #1144866)
   * getty-run: always test for fuser before calling it (Closes: #1105907)
   * d/control: use dh-sequence for dh_runit and dh_sysuser
   * d/control: drop {runit:Breaks} and {runit:Conflicts} for runit
   * d/control (runit-run): drop ancient Breaks and Replaces
   * bump S-V to 4.7.4, no changes required
Checksums-Sha1:
 8b86709175d2df04fa1cccd7452c10b8a6d24deb 2265 runit_2.3.1-5.dsc
 4d5550a17d5ffb8d9270bb139549e2a7125a2a41 90448 runit_2.3.1-5.debian.tar.xz
 bc4b5c13462a9f9fcd420ac476b071a85cee09c9 6934 runit_2.3.1-5_amd64.buildinfo
Checksums-Sha256:
 538a06cba27ef5f51e6e48b49d5bfaf98789a2ee635fda439d4bc53e590230f0 2265 runit_2.3.1-5.dsc
 4a13705a96dd79d19555584242ba51420b1e871da76ae07dd25845f2a5ed1a21 90448 runit_2.3.1-5.debian.tar.xz
 4ee723a42e71c06cbfe1953006b92280cb0ed43b8c499e376c20b0306a7a43ac 6934 runit_2.3.1-5_amd64.buildinfo
Files:
 f33ea6456a4991f34f5d4a7dd1cc03ef 2265 admin optional runit_2.3.1-5.dsc
 4a1892bbd1e1c971bcc40c39cab9baf3 90448 admin optional runit_2.3.1-5.debian.tar.xz
 99e305bf0d8d87105b3ed75831c6ef6b 6934 admin optional runit_2.3.1-5_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE2ji91PGnrxOd1bVNxxYb07RU7gMFAmrBSAYACgkQxxYb07RU
7gNgaQ//V9hWXyGgsIvtwkn6jdgFmptQJxKNtJMsGSPJLGLDWg5uUfYqtycc5FQi
JwsG4xNckWwnqQB0RiBIVDL3YlxWYf0paZYIjNLoquBtFJZt0WrpYqgmSYJM+Hnj
Tv7rle73pS8i6KzGtu0zkC02M6U/06oCYHEcqRiKlbxlnVfUpqKUb4rAzYQj+BW5
OZSZONKNPBt1EKKY3YCUYCltLvpss6CnGod8lOQZ1nqi52Tugupi+9Rk7UvM5hOy
i+zQA3GbfDyaFO5tE4vRc0dWyQsFhtKim5tXBGPmrhU8KecUuXGr4DClVbOSddqC
lrwm8LzFUdkzzd/tCpDcGUcaQIpiFbx+ojcd24oDBc9G+evgzmgW1r6fjOT57ZXu
zqRSGptKaUQrJijI9ZzerpUtT2xvK9HP/diC14RQhguvZZk5K7pe4lNKgS6rYChu
q7k7xsURuzz4/SavuX3N+zTfRiWWU8g0e/aahQHCIiUkwDIH2IFDYkjxJUM/oy2R
McYp1iOV6SMss8ePikjrqZmkowvCipGqV7PzzwYB/KrQX7doHZY6EiV4fGnUzev5
Tme5wvuz5L/VvwhZ0FsyS4NUIPT0V5oEI0MfomyzdjpvsFZlRZO+NgZtCRez6HCw
aGvo2fYYOud0F56kWLmbuXnzRQfiZld3p2z60wq+mZF7s62zDdc=
=XwEp
-----END PGP SIGNATURE-----