为什么 systemd 无法杀死用户进程? “无法杀死控制组”“忽略:不允许操作”

为什么 systemd 无法杀死用户进程? “无法杀死控制组”“忽略:不允许操作”

qemu从用户范围任务开始sytemd-run --user qemu-system... -pidfile pidfile

关闭时,systemd 声称它无法杀死它(没有尝试过)并发送一个SIGKILL,这不会正确终止 qemu 并保留 pidfile。

$ journalctl --user -b -1
...
systemd[884]: run-r0d56e38ca97d4493a5f496a19d18f6ae.scope: Failed to kill control group /user.slice/user-1000.slice/[email protected]/app.slice/run-r0d56e38ca97d4493a5f496a19d18f6ae.scope, ignoring: Operation not permitted
systemd[884]: run-r0d56e38ca97d4493a5f496a19d18f6ae.scope: Killing process 23775 (qemu-system-x86) with signal SIGKILL.
systemd[884]: run-r0d56e38ca97d4493a5f496a19d18f6ae.scope: Killing process 23778 (kvm-nx-lpage-recovery-23775) with signal SIGKILL.
systemd[884]: run-r0d56e38ca97d4493a5f496a19d18f6ae.scope: Failed to kill control group /user.slice/user-1000.slice/[email protected]/app.slice/run-r0d56e38ca97d4493a5f496a19d18f6ae.scope, ignoring: Operation not permitted
systemd[884]: Stopped /usr/bin/qemu-system-x86_64 -pidfile pidfile ...
systemd[884]: run-r0d56e38ca97d4493a5f496a19d18f6ae.scope: Consumed 30.007s CPU time, 774.1M memory peak, 0B memory swap peak.

我尝试搜索失败的字符串:"Failed to kill control group" "ignoring: Operation not permitted"并且在任何地方都得到零结果。

该进程很容易被用户或 root 杀死。一个简单的SIGTERM过程在1ms内结束。所以它也没有超时。顺便说一句,上面的所有日志行都发生在同一秒内。

是什么原因导致“不允许操作”?

相关内容