Kill will try to forcibly exit all of the processes in the cgroup. This is equivalent to sending a SIGKILL to every process. On kernels 5.14 and greater this will use the cgroup.kill file, on anything that doesn't have the cgroup.kill file, a manual process of freezing -> sending a SIGKILL to every
()
| 421 | // file, a manual process of freezing -> sending a SIGKILL to every process -> thawing |
| 422 | // will be used. |
| 423 | func (c *Manager) Kill() error { |
| 424 | v := Value{ |
| 425 | filename: killFile, |
| 426 | value: "1", |
| 427 | } |
| 428 | err := writeValues(c.path, []Value{v}) |
| 429 | if err == nil { |
| 430 | return nil |
| 431 | } |
| 432 | log.L.Warnf("falling back to slower kill implementation: %s", err) |
| 433 | // Fallback to slow method. |
| 434 | return c.fallbackKill() |
| 435 | } |
| 436 | |
| 437 | // fallbackKill is a slower fallback to the more modern (kernels 5.14+) |
| 438 | // approach of writing to the cgroup.kill file. This is heavily pulled |