Иногда бывает ситуация когда 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
🌍 Earth’s axis tilts about 23.5 degrees, causing our changing seasons. Without this tilt, much of the planet would have no summer or winter—just constant day or night at the poles. ✨
#earth⚡#seasons⚡#planet⚡#geography⚡#nature
👉subscribe Amazing Geography
👉more Channels
🪐 Uranus spins on its side compared to most planets, with its axis tilted at about 98 degrees from vertical. This extreme tilt means that each pole spends over 40 years in continuous sunlight, followed by 40 years of darkness, creating some of the most unusual seasonal changes among the giant planets. ✨
#Uranus⚡#seasons⚡#giants⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
Angola has two seasons: summer and cacimbo. Summer is warm and rainy from October to April. Cacimbo is dry and cooler from May to September.
@googlefactss
🌞🌧️❄️#Angola#Seasons#Weather#Climate
💋 Peach loves to be with Goma in every season of the year. 🍂🍃🌨️
What's your favorite season?
😍
#Nature#Seasons#Summer#Winter#Autumn#Monsoon#Cats#Cute#lovers#story#couples#catsoftelegram
💃@PeachLovesGoma
💃