[英]How can I kill a process that restart itself each time on Mac?
I need to use the port 5000 with flask but it seems to be already in use by some process.我需要将端口 5000 与烧瓶一起使用,但它似乎已被某些进程使用。
This is my output when I run sudo lsof -i:5000
:这是我运行sudo lsof -i:5000
时的输出:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ControlCe 1897 manu 32u IPv4 0x4ab7b80aa5149af7 0t0 TCP *:commplex-main (LISTEN)
ControlCe 1897 manu 32u IPv4 0x4ab7b80aa5149af7 0t0 TCP *:commplex-main (LISTEN)
Whenever I try to kill the process by running kill -9 $PID
it restarts immediately.每当我尝试通过运行kill -9 $PID
来终止进程时,它会立即重新启动。
I don't know what this process is and why is occupying the port 5000.不知道这个进程是什么,为什么会占用5000端口。
Of course I could set flask to use another port but I would really like to know what this process is and why I can't kill it.当然,我可以将烧瓶设置为使用另一个端口,但我真的很想知道这个过程是什么以及为什么我不能杀死它。
macOS Monterey has a new feature called "AirPlay Receiver" that uses port 5000. You can disable this feature in System Preferences -> Sharing -> AirPlay Receiver. macOS Monterey 有一项名为“AirPlay Receiver”的新功能,它使用端口 5000。您可以在“系统偏好设置”->“共享”->“AirPlay 接收器”中禁用此功能。 After this, you should find port 5000 free again.在此之后,您应该再次发现端口 5000 空闲。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.