macos Mac OS X 终端 killall 不会终止正在运行的进程
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/692528/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Mac OS X terminal killall won't kill running process
提问by Geuis
I have an instance of lighttpd running. When I do "ps -axc" the process is listed as
我有一个运行 lighttpd 的实例。当我执行“ps -axc”时,该过程被列为
"614 ?? 0:00.15 lighttpd"
But when I do "killall lighttpd" I get
但是当我做“killall lighttpd”时我得到
No matching processes belonging to you were found
I'm on Mac OS X 10.5.6. Is there something I'm missing?
我使用的是 Mac OS X 10.5.6。有什么我想念的吗?
回答by Andrew Jaffe
As per the other response, if it's not your process, prepend sudo
if you're an administrator. If not, you may be out of luck.
根据其他回复,如果这不是您的流程,sudo
如果您是管理员,请在前面加上。如果没有,你可能就不走运了。
Also, try sudo killall -9 lighttpd
which sends the specific signal KILL instead of TERM.
另外,尝试sudo killall -9 lighttpd
发送特定信号 KILL 而不是 TERM。
Just to be sure you can also try sudo kill -9 614
using the PID.
只是为了确保您也可以尝试sudo kill -9 614
使用 PID。
回答by Geuis
Is the task written in the ps aux list in brackets? If so, it is a zombie, it is waiting some I/O task, which probably never completes. You can't kill it as far as I know.
括号里是ps aux列表中的任务写的吗?如果是这样,它就是一个僵尸,它正在等待一些可能永远不会完成的 I/O 任务。据我所知,你不能杀死它。
回答by Brian Agnew
Does it belong to you ? If you do
它属于你吗?如果你这样做
ps aux | grep lighttpd
that will give you the user id associated with that process (I'm guessing it's chowned
to another user)
这将为您提供与该进程关联的用户 ID(我猜它是chowned
给另一个用户的)
回答by Vadim
It works: killall -u root -c lighttpd
有用: killall -u root -c lighttpd