fix(pxe): report dnsmasq as running when it drops to nobody #201
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/pxe-status-process-check"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
process_running()usedkill -0, which returns EPERM for a process owned by another user. dnsmasq drops privileges tonobodyafter binding its sockets, so an unprivileged caller saw a live server as dead.Found while recovering the thinkcentre:
./pxe-server.sh statusreporteddnsmasq (TFTP+DHCP): stoppedwhile ports 67 and 69 were bound and TFTP was servinguefi/ipxe.eficorrectly. That sent the debugging in the wrong direction.Three call sites were affected:
pxe-server.sh statusprinted a healthy server as stoppedstart_dnsmasqs already-running guard fell through, so a secondstartwould launch a duplicate dnsmasqcollectors/pxe.shreported statusdownto infra-dashTests
/proc/<pid>instead, which needs no signal permission, and validates the PID file is non-empty and numeric.collectors/pxe.shnow sources the shared helper instead of carrying its own copy of the check.Verification
Against the live server (dnsmasq PID 997301, nobody-owned):
pxe-server.sh status->dnsmasq (TFTP+DHCP): running (PID: 997301)collectors/pxe.sh->"status": "up", "dnsmasq": trueuefi/ipxe.efireturns a byte-identical file (md5ec084306769f659022fcbaa2e836751d)Negative controls, so the check can still return false: dead PID, garbage PID, empty file, and missing file all report not-running; a live PID reports running.