Иногда бывает ситуация когда 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
#Burhan: Military operations will continue until rebellion’s defeat
The Chairman of the Transitional Sovereign Council and Commander-in-Chief of the #Sudanese Armed Forces (#SAF), Lieutenant General Abdel Fattah al-Burhan, met on Sunday with Musa Hilal, head of the Revolutionary Awakening Council, in the presence of the Governor of Darfur, Minni Arko Minawi.
During the meeting, the Chairman of the Sovereign Council offered his condolences for the martyrs of Mustariha region who confronted the militia’s aggression and sacrificed their souls for the nation’s honor and dignity.
The meeting also addressed the situation in North Darfur State and the violations committed by the #RSF against civilians in the Mustariha region.
Burhan affirmed that SAF Forces are continuing their operations until the rebellion is eradicated and security and stability are restored all over the country......
https://sudanhorizon.com/burhan-military-operations-will-continue-until-rebellions-defeat/