Иногда бывает ситуация когда 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
Our NCDC 2023-2027 STRATEGY AND IMPLEMENTATION PLAN has been launched and is available for download
Access via
https://ncdc.gov.ng/themes/common/files/establishment/0ee30df42b787ee3bbced29b9930b27f.pdf
#NCDCStrategy#IamHealthSecurity#Vision2Action
We are very excited to present to you:
The Nigeria Centre for Disease Control and Prevention 2023-2027 STRATEGY AND IMPLEMENTATION PLAN
Download via
https://ncdc.gov.ng/themes/common/files/establishment/0ee30df42b787ee3bbced29b9930b27f.pdf
#NCDCStrategy#IamHealthSecurity#Vision2Action
Today, we're taking the next step by launching the NCDC Strategy 2023 to 2027, tagged ‘vision into action’"
Follow the discussion via
https://twitter.com/NCDCgov/status/1726894890158887036?t=Jd4yndV7SWHGomEakivxxA&s=19
#NCDCStrategy#IamHealthSecurity#Vision2Action
Our first strategy 'Idea to Reality' incorporated a new vision and mission that cascaded into 5 Strategic Goals, 22 Objectives and 89 Activities.
TOMORROW, November 21, marks another major milestone for #healthsecurity champions as we launch the:
📣Nigeria Centre for Disease Control and Prevention Strategy (2023-2027): #VisiontoAction📣
Don't miss out. Join us online via bit.ly/NCDCStrategyLaunch
#IAmHealthSecurity
The D-DAY has commenced.
Join us now as we kickstart our #HealthSecurity partners meeting and the #NCDCStrategy 2023-2027 launch event.
🔗bit.ly/NCDCStrategyLaunch
#IAmHealthSecurity#Vision2Action
Transforming our #Vision2Action, the #NCDCStrategy story continues 💪🏾
The #NCDCStrategy 2023-2027 is set to be launched❕
Join us for our health security partners meeting and strategy launch.
When❓
🗓️Tuesday, 21 November 2023
#SaveTheDate via
🔗bit.ly/NCDCStrategyLaunch
#IAmHealthSecurity