Kill services even when cgroups is disabled
process_cgroup_empty_ is used to indicate that a service is already killed or not. If cgroup support lacks, services cannot be killed because process_cgroup_empty_ is always true. This change fixes it by not assigning process_cgroup_empty_ as true. Instead, make KillProcessGroup send signals even when cgroup is disabled. Also DoKillProcessGroupOnce() is updated so it returns a number of killed processes, excluding already dead processes. This behavior agrees with its name (DoKillProcessOnce), and it prevents regression upon missing cgroups, because kill(-pgid) will always "succeed" so KillProcessGroup will loop even when all processes are already dead. Bug: 257264124 Test: boot microdroid, see services are terminated Change-Id: I19abf19ff1b70c666cd6f12d0a12956765174aaa
Loading
Please register or sign in to comment