简体   繁体   中英

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.

This is my output when I run 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.

I don't know what this process is and why is occupying the port 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. After this, you should find port 5000 free again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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