简体   繁体   English

我如何在 Mac OS X 中禁用守护进程/服务(运行但我无法杀死)

[英]How I can disable daemons / services (that run and that I can't kill) in Mac OS X

I want to kill a process on MacOS but after kill -9 PID it starts immediately.我想在 MacOS 上终止一个进程,但在kill -9 PID之后它会立即启动。

Try to find out id this process is a daemon/service: sudo launchctl list | grep PROCESS_NAME尝试找出 id 这个进程是一个守护进程/服务: sudo launchctl list | grep PROCESS_NAME sudo launchctl list | grep PROCESS_NAME

If so (most probably), there are some places where you can find related.plist daemon files:如果是这样(很有可能),您可以在某些地方找到 related.plist 守护程序文件:

~/Library/LaunchAgents/ - Per-user agents provided by the user.
/Library/LaunchAgents/ - Per-user agents provided by the root.
/Library/LaunchDaemons/ - System-wide daemons provided by the root.
/System/Library/LaunchDaemons/ - System-wide daemons provided by MacOS
/System/Library/LaunchAgents/ - Per-user agents provided by MacOS.

After you find the related file:找到相关文件后:

sudo launchctl unload -w /path/to/DAEMON_NAME.plist

And now you can remove this file.现在您可以删除此文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM