Иногда бывает ситуация когда dev-сервер по какой-либо причине не закрылся и висит в процессах, занимая порт.
Это может быть из-за падения IDE или просто сам забыл погасить и закрыл терминал.
Для таких случаев я набросал простую функцию с командой:
kill_on_port() {
port=$(lsof -t -i:$1)
echo "KILL PROCESS:" $port
sudo kill -9 $port
}
alias killonport="kill_on_port $@"
Код поместить в ~/.bashrc и рестартнуть систему.
Если во время старта dev-сервера получаете ошибку что порт уже занят, просто выполните команду, подставив свой порт.
Bash
kill_on_port 8000
Скорее всего бесполезно, если другой процесс назначен на перезапуск вашего dev-сервера в случае падения.
Имя команды можете изменить на любое другое.
#linux
On January 9, 1493, Columbus saw three “mermaids” near the Dominican Republic. He said, “They are not as beautiful as they are painted, for their faces had some masculine traits.” These were actually manatees, big sea animals with whiskers. Sailors often thought manatees were mermaids because they look a little like people from far away.
🐋🌊
[Read more]
@googlefactss
#History#Animals#Mermaids#Manatees
Manatees find allies in coastal Cuban town
Manatees, nicknamed ‘sea cows,’ are in a critical situation due to poachers, so fishermen and residents of the coastal town of Santa Fe, Cuba, have joined forces to protect them.
#Manatees#seacows#Cuba#News#Reuters
Subscribe: http://smarturl.it/reuterssubscribe
Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled.
Get the latest news on: http://reuters.com/
Follow Reuters on Facebook: https://www.facebook.com/Reuters
Follow Reuters on Twitter: https://twitter.com/Reuters
Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en
➖@reutersworldchannel➖