Foreword
Using the GAE engine in OS x to science onlinegoagentorwallproxy,May occur during the boot process the following error then the service does not start successfully。
1 2 3 |
socket.error: [Errno 48] Address already in use //如上报错,错误号48;端口已被占用。 |
Reason
Actually it is because you have to start the same or similar services for the port,usually,Start with Python on the Mac directly,Causes an exit is not complete,You can't GUI by clicking on the "exit" button to stop,There is a background of the Python process,And it is always occupied port does not release the culprit。
Solution
One is to get rid of the default8087、8086port,The other one,Is to kill occupation of port procedures。
The former immediate,But the disadvantage is that you cannot change in a day,If because of other occupied ports has to say,If exit is not complete? So,The latter is a stopgap solution。But wanted to see the program occupied the port,Should be introduced the following content:
Lsof command
Profile
lsof(List open files) command is a list of the currently opened file tool。Under in the UNIX environment,Everything exists as a file,Through the file not only can access a common data,Can also access the network connectivity and hardware。So we use it to find the occupation of port procedures,See whether the conflicts are not errors。
lsof -i To display the qualifying process
so,We use the following command to find out the occupation of a port program and the corresponding PID
1 2 3 |
sudo lsof -i:8087 //因为有些时候是以root身份运行,所以请务必加上sudo |
Then use the following command to kill the corresponding process:
1 |
sudo kill *pid*//*部分用对应进程的PID来填充哦 |
correct,If you want to see what this program is,Here is not recommended to use the command line to complete the,of course,Again use the lsof command can be,Make or recommend you to use "active monitor" to find PID--after all,The graphics capabilities of the system。
Original article written by LogStudio:R0uter's Blog » Mac OS X resolved socket.error: [Errno 48] Address already in use Port occupation problem
Reproduced Please keep the source and description link:https://www.logcg.com/archives/536.html
Thnak you very much!!
Write more neutral,Understanding。Thank you ~