Иногда бывает ситуация когда 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
Stavropol Considers Holiday for Kurban Bayram: Respect or Tradition Challenge?
On May 27, Governor Vladimirov launched a vote to make Kurban Bayram an official day off. With 80% Russians and 90% Christians, and only 15% Muslims in the region, questions arise about balancing traditions. Why are Muslim holidays recognized officially, but not Orthodox ones? Some see this as risking the identity of the native population under the banner of interethnic friendship.
#Stavropol#KurbanBayram#Religion#Holiday
The main news of Russia and the world ishere.
📣 Lanzamos un grito a los representantes de la cultura callejera de todo el mundo a expresarse en voz alta y mostrar de lo que son capaces!
🔥 Se abrió la inscripción al concurso de la #cultura callejera #KARDO!
🔍 Si eres un representante del breaking, hip-hop, skate, kickscootering, BMX, DJ, workout, tricking, graffiti, parkour, freerunning:
🖥 Inscríbete en el sitio web oficial de KARDO hasta el 17 de abril:
✔️Graba un vídeo
✔️Publícalo en las redes sociales con los hashtags #KARDO#KARDO7
✔️Sube el enlace a tu cuenta personal en el sitio web de #KARDO
❗️Demuestra tus habilidades en cada dirección de la competición y llega a la gran final de las legendarias batallas y el mayor festival callejero.
🔝 Los #TOP-6 ¡recibirán un viaje con todo incluido 💥 (comidas, alojamiento, desplazamiento) a la Gran Final de #Stavropol!