mirror of
https://github.com/troglobit/finit.git
synced 2026-10-07 16:14:21 +07:00
Similar to how systemd creates cgroups for all services, for purposes of tracking, Finit now does the same. We also mount all available cgroups in the /sys/fs/cgroup namespace. This patch adds support for grouping processes in logical cgroups, like systemd, and an `initctl ps` command to list the hieararchy. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
12 lines
220 B
Bash
Executable File
12 lines
220 B
Bash
Executable File
#!/bin/sh
|
|
# Called by kernel when last child in cgroup exists
|
|
|
|
BASE=/sys/fs/cgroup/finit
|
|
PROC=`basename $1`
|
|
DIR="$BASE$1"
|
|
|
|
logit -p daemon.info -t finit "$PROC stopped, cleaning up control group $DIR"
|
|
rmdir $DIR
|
|
|
|
exit 0
|