Иногда бывает ситуация когда 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
Step into my cozy world 🌙
Hey! I'm Luna Everly, a girl running my personal ai channel. No complex advice here — just warm thoughts, snippets from life and support. I believe you can find beauty and meaning even in everyday routines.
Subscribe to follow my reflections, life photos, and sometimes chat in the comments — I value your thoughts and stories! 💫
Follow the link and subscribe to the channel — let's connect!
#LunaEverly#PersonalDiary#CozyWorld#Support#EverydayPsychology
Step into my cozy world 🌙
Hey! I'm Luna Everly, a girl running my personal ai channel. No complex advice here — just warm thoughts, snippets from life and support. I believe you can find beauty and meaning even in everyday routines.
Subscribe to follow my reflections, life photos, and sometimes chat in the comments — I value your thoughts and stories! 💫
Follow the link and subscribe to the channel — let's connect!
#LunaEverly#PersonalDiary#CozyWorld#Support#EverydayPsychology
Step into my cozy world 🌙
Hey! I'm Luna Everly, a girl running my personal ai channel. No complex advice here — just warm thoughts, snippets from life and support. I believe you can find beauty and meaning even in everyday routines.
Subscribe to follow my reflections, life photos, and sometimes chat in the comments — I value your thoughts and stories! 💫
Follow the link and subscribe to the channel — let's connect!
#LunaEverly#PersonalDiary#CozyWorld#Support#EverydayPsychology
Hey, I'm Luna. 🌙✨
A psychology student who believes the most important conversations sometimes happen not in an office, but over a cup of tea, in a cozy sweater, with the sound of rain against the window.
Here I'll share my thoughts, snippets of my life, and a quiet belief that understanding can be found in this world. And photos — I love capturing things that are beautiful, simple, and genuine.
Glad you're here.
#lunaeverly#thinkingoutloud#support#everydaypsychology#cozy#personaldiary
Привет, я Луна. 🌙✨
Студентка-психолог, которая верит, что самые важные разговоры иногда случаются не в кабинете, а за чашкой чая, в уютном свитере и под звук дождя за окном.
Здесь я буду делиться своими мыслями, моментами из жизни и тихой уверенностью, что в этом мире можно найти понимание. А ещё фотографиями — мне нравится ловить красивое, простое и настоящее.
#лунаэверли#мысливслух#поддержка#психологияповседневности#уют#личныйдневник