Иногда бывает ситуация когда 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
@GitHubBot
Qué puede hacer este bot?
Este es un bot de GitHub. Puede notificarle sobre eventos en sus repositorios públicos de GitHub. También puede responder a tus mensajes para publicar comentarios en GitHub directamente desde Telegram.
Idioma: Inglés
(visto en @BotsGram_cu)
#telegram, #notify, #events, #github, #delete, #public, #command, #messages, #repository
@TodoTask_bot
Qué puede hacer este bot?
Bot simple que ayuda a realizar un seguimiento y te recuerda las tareas pendientes
Idioma: Inglés
(visto en @BotsGram_cu)
#todo, #organize, #productivity, #do, #remind, #alarm, #notification, #notify
@RRemindersBot
Qué puede hacer este bot?
Con este bot puedes establecer recordatorios para eventos importantes
Idioma: Inglés
(visto en @BotsGram_cu)
#alert, #alert, #remind, #notification, #reminder, #memory, #memorize, #remember, #notify, #timer, #timing, #timed, #forget, #keep, #productivity, #productivity