Any chainloading program to call prctl(PR_SET_PDEATHSIG, signal)

From: Mario Rugiero <mrugiero_at_gmail.com>
Date: Wed, 11 Oct 2023 15:17:23 -0300

Last Monday I was reminded the bad way that children don’t get killed when their parents died (my memory failed me and I thought that behavior was opt-in by detaching). I’m not sure whether a PHP service was misconfigured or maybe my h2o server was hit by that massive DDoS attack a few days ago, but I had some OOM killer hits.
The kernel, very cleverly, decided to kill only the most important and light processes (all supervisors plus mingetty) instead of the actually memory hoarders, leaving tons of unsupervised processes running, which in turn kept the sockets in use, meaning the new supervisors launching new services would fail until I killed them myself.
It turns out there is this Linux specific syscall (prctl(PR_SET_PDEATHSIG, signal)) to set the saner behavior of actually being informed if your parent dies and react to it so s6 is able to bring service back up, but it’s opt-in. Is there any tool in the s6 ecosystem or otherwise that I can use to call it before exec’ing to the service itself? I couldn’t find in s6-linux-utils and I would guess it’s not part of the portable tools, being Linux specific. Is there a portable equivalent? Is there any interest in receiving a patch, alternatively?
Received on Wed Oct 11 2023 - 20:17:23 CEST

This archive was generated by hypermail 2.4.0 : Wed Oct 11 2023 - 20:18:12 CEST