TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The history of sending signals to Unix process groups

129 pointsby r4umover 2 years ago

7 comments

oconnor663over 2 years ago
If anyone can suggest an update to <a href="https:&#x2F;&#x2F;github.com&#x2F;oconnor663&#x2F;duct.py&#x2F;blob&#x2F;master&#x2F;gotchas.md#killing-grandchild-processes" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;oconnor663&#x2F;duct.py&#x2F;blob&#x2F;master&#x2F;gotchas.md...</a>, please let me know. As far as I&#x27;m aware, there&#x27;s still no reliable way to kill a tree of processes on Unix that&#x27;s suitable for library code.
评论 #32735142 未加载
评论 #32735835 未加载
评论 #32734798 未加载
评论 #32734885 未加载
评论 #32739389 未加载
评论 #32735786 未加载
评论 #32737364 未加载
评论 #32739659 未加载
评论 #32734867 未加载
评论 #32739275 未加载
评论 #32735439 未加载
评论 #32735826 未加载
评论 #32740484 未加载
ur-whaleover 2 years ago
All I ever wanted was to type ^C (or perhaps ^\) in my terminal and kill in one fell swoop all the shite that my previous shell-typed command spawned directly or indirectly.<p>This, IIRC used to be the standard behavior back in the days, but in recent years, for some reasons, things have not been so simple.<p>Looking at the man page of ps(1) sort of starts to elucidate the effing mess that the name &quot;group&quot; summons the in unix process world.<p>Are we talking about the real group id (RGID), the effective group id (EGID), the controlling progress group id (TPGID), the control group (CGROUP) the textual group id (EGROUP), the filesystem group id (FGID), the textual filesystem group id (FGID), the process id of the process group leader (PGID), the saved group id (SGID), the session id (SID), the supplementary group id (SUPGID), the thread group id (TGID) ?<p>I&#x27;m pretty sure I&#x27;m missing some.<p>What an effing mess.
评论 #32734759 未加载
评论 #32734896 未加载
评论 #32735170 未加载
评论 #32735538 未加载
JdeBPover 2 years ago
If one is familiar with POSIX and why it is how it is, one knows that the reason that POSIX has both sessions and process groups is that &quot;sessions&quot; pretty much descend from AT&amp;T System 3 process groups and &quot;process groups&quot; descend from BSD process groups; so one would indeed have expected that there were two separate ideas of &quot;process group&quot;.<p>Things that this history does not cover include System 5 Release 2 &quot;shell layers&quot;. Shell layers multiplexed virtual terminals onto a single physical terminal, preceding its obvious successors screen by somewhere around three years, and tmux by about quarter of a century. The popularity of tmux and screen nowadays shows that the BSD job control mechanism did not entirely kill off the vision of shell layers, as I recall people thinking it had at the time.
ddevaultover 2 years ago
Process groups and job control is a huge fucking mess on Unix. Process groups, job control, and signals are probably the biggest mistakes of Unix&#x27;s design. Arguably fork(2) as well, but that&#x27;ll probably raise some eyebrows. The blame for Berkley sockets and ioctls can&#x27;t entirely be laid at Unix&#x27;s feet, but they&#x27;re also quite the mess.
评论 #32734678 未加载
评论 #32734889 未加载
bluetomcatover 2 years ago
It’s a mess that originates from the dated concept of terminals and that users are necessarily bound with interactive sessions from them. Without the notion of terminals and special control sequences, process hierarchy control can be much simpler and more orthogonal. A “signal” would be sent to the leaf processes in the hierarchy first, then they terminate, notifying their parent and so on.
评论 #32735215 未加载
ameliusover 2 years ago
Question: can we control a Linux process (with all its threads, signal handlers etc.) in a completely deterministic way, e.g. by using ptrace() on it?
评论 #32735672 未加载
评论 #32735502 未加载
killpgover 2 years ago
killpg is my favorite syscall