Иногда бывает ситуация когда 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
📰 The One Trick That Made Immutable Linux Easier For Me
There's a systemd utility that lets you "inject" tools into a read-only OS at runtime, without rebooting the system. Here's my exploration.
🔗 Source: https://feed.itsfoss.com/link/24361/17309280/systemd-sysext
#linux#systemd
📰 Fish 4.6 Shell Brings Support For Recent systemd Environment Variables
Fish 4.6 released today as the newest version of this Rust-based interactive shell for Linux and other platforms...
🔗 Source: https://www.phoronix.com/news/Fish-4.6-Released
#systemd#linux
📰Systemd Introduces Birth Date Support for Upcoming Linux Desktop Age Controls
A recent systemd update introduces birth date storage, supporting ongoing efforts to implement age-based access controls in the Linux desktop stack.
🔗 Source: https://linuxiac.com/systemd-introduces-birth-date-support-for-upcoming-linux-desktop-age-controls/
#linux#systemd
📰 systemd 260-rc2 Released With More Changes
Last week marked the release of systemd 260-rc1 with a new "mstack" feature, a new "FANCY_NAME" field for os-release, dropping System V service script support, and other changes. Out today is systemd 260-rc2 release with more changes in further working its way toward a stable release for empowering 2026 Linux distributions...
🔗 Source: https://www.phoronix.com/news/systemd-260-rc2
#systemd#linux
📰 New to Linux? These 4 systemd Tools Help You Fix Common Issues
Stop guessing, start investigating. Here are 4 systemd tools that make Linux troubleshooting easy.
🔗 Source: https://itsfoss.com/systemd-troubleshoot-tools/
#linux#systemd
📰Linus T tells The Reg how Linux solo act became a global jam session
Ts'o, Hohndel and the man himself spill beans on how checks in the mail and GPL made it all possible If you know anything about Linux's history, you'll remember it all started with Linus Torvalds posting to the Minix Usenet group on August 25, 1991, that he was working on "a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones.
🔗 Source: https://go.theregister.com/feed/www.theregister.com/2026/02/18/linus_torvalds_and_friends/
#linux#gnu
[$] Finding a successor to the FHS
文件系统层次标准(FHS)旨在规范Linux系统的文件和目录布局,以简化跨发行版的应用程序开发。然而自2015年以来,FHS标准已停滞不前。目前虽有缓慢推进的FHS 4.0复兴计划,但Fedora开发者近期讨论转向采用systemd的《file-hierarchy》文档方案,该方案已被纳入Linux用户空间API(UAPI)组的规范体系。
原文链接:https://lwn.net/Articles/1032947/
#Linux#系统标准#文件系统#开源开发
#AIGC
Read more