Use cgroup.kill in cgroup_cleanup when possible

The old code is moved to a cgroup_fallback_cleanup function and only
 called if cgroup2_kill fails.

 This fixes #454.
This commit is contained in:
Aidan Harris
2021-09-15 07:11:01 +00:00
committed by William Hubbs
parent cd4bbdcd62
commit eaa42da9a6
2 changed files with 24 additions and 5 deletions
+3 -1
View File
@@ -288,7 +288,9 @@ rc_tty_number=12
# To perform this cleanup manually for a stopped service, you can
# execute cgroup_cleanup with /etc/init.d/<service> cgroup_cleanup or
# rc-service <service> cgroup_cleanup.
# The process followed in this cleanup is the following:
# If the kernel includes support for cgroup2's cgroup.kill, this is used
# to reliably teardown the cgroup.
# If this fails, the process followed in this cleanup is the following:
# 1. send stopsig (sigterm if it isn't set) to all processes left in the
# cgroup immediately followed by sigcont.
# 2. Send sighup to all processes in the cgroup if rc_send_sighup is