mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-05 12:37:54 +00:00
195ab4243b
Re-fork the install monitor from the main service loop when $pid_MON has been cleared and xcatiport is still configured, so a single death of that child no longer leaves the port dead until the whole daemon is restarted. The forked child closes the SSL listener and the UDP control socket before re-entering do_installm_service, so it serves only the install monitor. Rate limit the respawn. do_installm_service dies when it cannot bind the port after its own retries, which is exactly the case where an unguarded re-fork would spin as fast as fork allows and keep re-entering that function's USR2 socket-takeover handshake against whatever still holds the socket. Consecutive attempts are separated by XCATD_MON_RESPAWN_INTERVAL seconds (default 5) and capped at XCATD_MON_RESPAWN_MAX (default 10), after which xcatd logs that it is giving up on the port rather than retrying forever. A monitor that stayed up long enough to outlast the whole retry budget resets the counter, so an unrelated death much later gets a full budget again. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>