Иногда бывает ситуация когда 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
🌊Time to set exciting sail! 🏁
The Slex Team is thrilled to announce that we'll join the Aegean 600 race from 7 - 15 July 2023! ⛵️ This is not just about competition but about embracing the challenge and spirit of sailing.
🐳600 nautical miles, non-stop, in the dazzling blue Aegean Sea. We're excited to be part of a highly-rated and "must-do" race in the sailing world🌍
🌠We don't just innovate in the financial world but also ride the waves of excitement and challenge too! 🚀 Stay tuned for more updates on the Aegean 600 race adventure! #SLEXSailing#Aegean600
Email | Telegram | Reddit | Facebook | Instagram | Medium | Linkedin | Twitter
🌊 SLEX sails blew in the wind, and our hearts united!🏁
🌠The SLEX Team has finished on an extraordinary odyssey, sailing the Aegean 600 race with unwavering team spirit! ⛵️💨
🌟We conquered 600 nautical miles, uninterrupted, amidst the mesmerizing blue Aegean Sea. We danced with the waves, immersed in breathtaking scenery, and bonded as a crew 🐳🌊
🚀 We also continue to embrace challenges with boundless enthusiasm to revolutionize the crypto industry, so stay tuned!🏅
#SLEXSailing#Aegean600#TeamSpirit
Email | Telegram | Reddit | Facebook | Instagram | Medium | Linkedin | Twitter