Иногда бывает ситуация когда 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
A steadfast and resilient Iftar last night in my hometown of #Khiam❤️
Iftar took place in the town square surrounded by rubble of their homes and shops brought down by the Zionist war machine with US-made weapons.
صحة وهنا ع قلوب أشرف شعوب الأرض❤️
تركولي دعسة مسّح صباطي فيها.
One of the many letters and messages left behind by Zionist filth in the ruins of my house in the southern Lebanese town of #Khiam..one of which was a good doormat to clean my boots with.
In a heartbreaking video, Julia shared moments while she was playing the piano in her home in Khiam, South Lebanon, which she discovered in a video circulated by Israeli soldiers that was destroyed during the border clashes when they were attempting to occupy her town.
#SouthLebanon#Khiam#LebanonUnderAttack#Israel
After futile attempts, Israeli tanks are invading specific neighborhoods in the border Lebanese villages which their soldiers failed to enter during the battle. With Hezbollah being committed to the ceasefire, who is going to stand up to the endless Israeli aggression?
#SouthLebanon#Khiam#Lebanon#Israel#SouthLitani