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



我想终止MacOS上的一个进程,但在kill -9 PID之后,它会立即启动。

尝试找出此进程是守护进程/服务的id:sudo launchctl list | grep PROCESS_NAME

如果是这样(很可能(,您可以在一些地方找到相关的.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.

找到相关文件后:

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

现在您可以删除此文件。

最新更新