Иногда бывает ситуация когда 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
Protecting our communities from hospital-acquired infections starts with strong Infection Prevention and Control #IPC programs in our health facilities.
We must invest more in these initiatives to safeguard public health and prevent the next epidemic.
#PreventionHAIs
#FundIPC
#TurnNigeriaOrange
Protecting our communities from hospital-acquired infections starts with strong Infection Prevention and Control #IPC programs in our health facilities.
We must invest more in these initiatives to safeguard public health and prevent the next epidemic.
#PreventionHAIs
#FundIPC
#TurnNigeriaOrange
Protecting our communities from hospital-acquired infections starts with strong Infection Prevention and Control #IPC programs in our health facilities.
We must invest more in these initiatives to safeguard public health and prevent the next epidemic.
#PreventionHAIs
#FundIPC
#TurnNigeriaOrange
Sustained domestic funding for #InfectionPreventionandControl is an essential investment in the fight against healthcare-associated infections and #antimicrobialresistance.
Let's protect lives, support research, and safeguard our healthcare systems.
#TurnNigeriaOrange
#PreventHAIs
#FundIPC
Protecting our communities from hospital-acquired infections starts with strong Infection Prevention and Control #IPC programs in our health facilities.
We must invest more in these initiatives to safeguard public health and prevent the next epidemic.
#PreventionHAIs#FundIPC
#TurnNigeriaOrange#IPCTWG