fix(nhc): carry the sshd process-title colon to all Ubuntu releases - #1406
Open
100milliongold wants to merge 1 commit into
Open
fix(nhc): carry the sshd process-title colon to all Ubuntu releases#1406100milliongold wants to merge 1 commit into
100milliongold wants to merge 1 commit into
Conversation
OpenSSH rewrites its process title, so every sshd -- listener, privsep parent and session alike -- carries argv[0] "sshd:" with a trailing colon. check_ps_service compares the daemon name against that first token, so the name it is given must carry the colon too. The role already knows this and sets nhc_ssh_daemon: "sshd:" in the 20.04 and 22.04 vars files. It is not set in ubuntu.yml, which with_first_found falls back to whenever no file matches the running release. On Ubuntu 24.04 the role default "sshd" therefore applies, no process matches, and nhc reports sshd down on a node where sshd is running normally -- once per HealthCheckInterval. Setting it in ubuntu.yml fixes 24.04 and keeps the next release from regressing the same way. The 20.04 and 22.04 files keep their own copies; with_first_found stops at the more specific file, so they are unaffected. Verified on two Ubuntu 24.04 nodes, OpenSSH_9.6p1: 22 and 21 consecutive health-check failures at a 300 s interval, then none after the rendered line carried the colon. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Ubuntu 24.04, NHC reports sshd as down while sshd is running normally.
HealthCheckIntervalis 300 s by default, so it is one failure every five minutes:Cause
OpenSSH rewrites its process title, so every sshd carries
argv[0]ofsshd:-- with a trailing colon -- whether it is the listener, the privsep parent or a session:check_ps_servicecompares the daemon name against that first token (lbnl_ps.nhc:MATCH="*$DAEMON", thenARGS=( ${PS_ARGS[$THIS_PID]} )), so the name it is given has to carry the colon too.The role already knows this:
There is no
ubuntu-24.04.yml, sowith_first_foundinroles/nhc/tasks/main.ymlfalls through toubuntu.yml-- which setsnhc_build_depsbut notnhc_ssh_daemon. The role default"sshd"applies, nothing matches, and the check fails.slurmdon the next line is the control: it does not rewrite its title, itsargv[0]is the plain path/usr/local/sbin/slurmd, and that check passes on the same node in the same run.Fix
Set
nhc_ssh_daemon: "sshd:"inubuntu.ymlrather than adding anubuntu-24.04.yml, so the next Ubuntu release does not regress the same way. The 20.04 and 22.04 files keep their own copies and are unaffected --with_first_foundstops at the more specific file.Scope is Ubuntu only. I have no RHEL node to measure on, so
redhat.ymland themain.ymldefault are left alone.Verification
Two Ubuntu 24.04 nodes, OpenSSH_9.6p1 Ubuntu-3ubuntu13.19, Slurm
HealthCheckProgram=/usr/sbin/nhc,HealthCheckInterval=300.Before -- consecutive periodic failures, 5 minutes apart:
With the rendered line carrying the colon (
<host> || check_ps_service -u root -d sshd: sshd):Control, same nodes, colonless name restored:
No periodic failure after the change, and neither node was left drained.
🤖 Generated with Claude Code