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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 06:05:12  来源:igfitidea点击:

Mac OS X terminal killall won't kill running process

macosterminal

提问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 sudoif you're an administrator. If not, you may be out of luck.

根据其他回复,如果这不是您的流程,sudo如果您是管理员,请在前面加上。如果没有,你可能就不走运了。

Also, try sudo killall -9 lighttpdwhich 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 614using 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 chownedto another user)

这将为您提供与该进程关联的用户 ID(我猜它是chowned给另一个用户的)

回答by Vadim

It works: killall -u root -c lighttpd

有用: killall -u root -c lighttpd