1
2
3
4
5
6
7
8
9
# vim: ft=zsh noet ts=4 sts=4 sw=4
local N
N=${#${="$(<$zsv_cgroup/tasks)"}}
(($N)) || return

while (($N)) && [[ -n "$(<$zsv_cgroup/tasks)" ]]; do
	N=$[ $N - 1 ]
	start-stop-daemon --stop --retry TERM/10/KILL/5 --pidfile $zsv_cgroup/tasks
done