Иногда бывает ситуация когда 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
🐍During this festive season of the #LunarNewYear, the entire CyberCharge team wishes you a Happy Year of the Snake!
May this year bring prosperity and joy to you and your loved ones 🫂
Thank you for your continued support, helping us grow and achieve incredible milestones.
We're just getting started! 🚀
🤖Earn NOW📱X(Twitter) 📱Chat💬Discord📱YouTube
Dear friends,
Warm greetings on the occasion of #LunarNewYear!
We wish you good health, happiness and prosperity! May this upcoming year bring along success and great fortune for you and your families.
Sincerely yours,
Russian Mission to #ASEAN
Bringing good luck and prosperity into the new year with the power of red! From lanterns 🏮 to envelopes 🧧, red is a traditional color of #ChineseNewYear. Don't forget to add a touch of red to your celebrations for a prosperous.
Принося удачу и процветание в новый год силой красного! От фонарей до конвертов, красный является традиционным цветом #ChineseNewYear. Не забудьте добавить нотку красного к своим празднованиям для процветающего.
#LunarNewYear#wallpaper
🧧 Follow 🧧@PeachLovesGoma🧧
Wish everyone a happy Lunar New Year! Bring glory back to Hong Kong in the year of dragon!
#HKDMovement
#glorytoHongKong
#lunarnewyear
#standwithhongkong