mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-05 12:37:54 +00:00
d73cd41415
The install monitor -- the child listening on xcatiport for node install-status updates and the "next" boot-flip request -- is forked exactly once at daemon startup. When it dies the SIGCHLD reaper only clears $pid_MON and nothing re-forks it, so a single death of that child (a stray signal, or a lost socket takeover during an xcatd restart) leaves xcatiport permanently dead while the main daemon keeps running. Installing nodes can then no longer report booted or request the boot flip until the whole daemon is restarted, which is disruptive to any concurrent operation. A respawn must also be rate limited. do_installm_service dies when it cannot bind the port after its own retries, so an unguarded re-fork in the main loop would spin as fast as fork allows for as long as the port stays held, and would collide with that same function's USR2 socket-takeover handshake. Assert that the main loop re-forks the monitor, that the child re-enters do_installm_service, and that respawns are spaced, capped, and reported on exhaustion. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>