Иногда бывает ситуация когда 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
"Faites un max de bruit, ne lâchez pas la pression !" - Rima Hassan (via son avocate) depuis la prison de Givon, détenue illégalement par Netanyahu.
Vous étiez encore présents en nombre ce soir Place de la République! On lâche pas !! Force Rima ! Force Gaza !
#StopBlocus#StopGenocide
-----------
On vous a transféré ce message ? Abonnez-vous au canal Telegram de Jean-Luc Mélenchon sur : https://t.me/JLMelenchon
🔴URGENT - Rassemblement pourla libération sans conditions des prisonniers et la fin du blocus à Gaza !
Ce mardi 10 juin à 18h, rendez-vous à la Place de la République à Paris.
Soyons nombreuses et nombreux ! Merci de partager ce message !
#FlottilleDeLaLiberté#FreedomFlotilla#StopGenocide
-------
Plus d'infos : https://t.me/FranceInsoumise
Gaza is being destroyed, and the Arab world is silent!
Israel is raining fire on Gaza day after day.Beneath the bombs and rockets, the ground trembles, but even more, a mother’s heart shakes in fear.
Children no longer ask for toys—they beg for safety.Women don’t seek adornments—they yearn for a chance to survive.
And us?
Most Arab leaders stay mute. Some even shake hands with this oppressor.While the Muslim nation drowns in blood, they’re lost in luxury and self-interest.
But Allah sees.He hears the cries of the oppressed.One day, the tyrants will face justice—no one will escape.If we stay silent today, history will curse us tomorrow.Pray for Gaza, speak up, stand for truth.
#FreePalestine🇵🇸
#StandWithGaza
#StopGenocide
#SaveHumanity