Re:Signals in Prod: Dangers and Pitfalls
by 0xbadcafebee on Monday October 03, 2022 @11:16PM
(#33076365)
Completely unrelated, but useful: POSIX kill (or kill()) with signal 0 is a portable way to check if a process controllable by the current user is alive.
[ Parent
| on HN ]
Could you elaborate on what makes that a great way to check and what advantage that has over other methods?
Re:Signals in Prod: Dangers and Pitfalls
by saagarjha on Tuesday October 04, 2022 @01:45AM
(#33077011)
It doesn’t do anything but returns a result based on the existence of the process and your ability to signal it, which makes it a sort of “dry run” of sorts. Note that such a check is inherently racy, though.
Re:Signals in Prod: Dangers and Pitfalls
by LunaSea on Tuesday October 04, 2022 @02:38AM
(#33077248)
> Note that such a check is inherently racy, though.
Do you mean in a kind of "time of check vs. time of use" kind of way?
I would suppose that if the answer is negative that would at least stay true no?