我想终止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
现在您可以删除此文件。