add ErrCgroupNotExist

For some rootless container, runc has no access to cgroup,
But the container is still running. So we should return the
`ErrNotRunning` and `ErrCgroupNotExist` error seperatlly.

Signed-off-by: lifubang <lifubang@acmcoder.com>
This commit is contained in:
lifubang
2024-09-23 20:59:57 +08:00
committed by lfbzhm
parent 15904913c2
commit 10c951e335
3 changed files with 14 additions and 10 deletions
+1 -3
View File
@@ -695,11 +695,9 @@ func setupPersonality(config *configs.Config) error {
// signalAllProcesses freezes then iterates over all the processes inside the
// manager's cgroups sending the signal s to them.
//
// signalAllProcesses returns ErrNotRunning when the cgroup does not exist.
func signalAllProcesses(m cgroups.Manager, s unix.Signal) error {
if !m.Exists() {
return ErrNotRunning
return ErrCgroupNotExist
}
// Use cgroup.kill, if available.
if s == unix.SIGKILL {