fix(nhc): match sshd despite its rewritten process title - #1405
Closed
100milliongold wants to merge 1 commit into
Closed
fix(nhc): match sshd despite its rewritten process title#1405100milliongold wants to merge 1 commit into
100milliongold wants to merge 1 commit into
Conversation
check_ps_service defaults its match pattern to "*$DAEMON", which requires the token to end with the daemon name. OpenSSH rewrites its process title, so on Ubuntu every sshd carries argv[0] "sshd:" with a trailing colon: sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups sshd: ubuntu [priv] sshd: ubuntu@notty NHC compares the first whitespace-separated token of args against "*sshd", "sshd:" does not end in "sshd", and the check reports the service down on a node where sshd is running normally. It fires on every interval, so with HealthCheckInterval=300 it is a failure every five minutes. Widen the pattern with -m. slurmd is unaffected: its argv[0] is the plain path /usr/local/sbin/slurmd. Verified on two Ubuntu 24.04 nodes, OpenSSH 9.6p1: nhc went from one sshd failure to exit code 0 with no error lines.
Contributor
Author
|
Closing this in favour of a smaller fix that follows the pattern already in this role. After opening this I found that the role already handles the trailing colon, per OS: There is no So the template did not need changing at all -- the variable simply never reaches Ubuntu 24.04. Widening the match pattern here would also have produced a redundant Replaced by #1406. |
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 every node this role configures, NHC reports sshd as down while sshd is running normally. With the default
HealthCheckInterval, that is a failure on every interval.Root cause
check_ps_serviceinlbnl_ps.nhcdefaults its match pattern to*$DAEMONwhen-mis not given:and compares it against the first whitespace-separated token of the process arguments:
OpenSSH rewrites its process title. Every sshd -- listener, privsep parent and session alike -- therefore carries
argv[0]ofsshd:, with a trailing colon:The glob
*sshdrequires the token to end withsshd.sshd:does not, so no process ever matches and the check reports the service down.slurmdon the line immediately below is unaffected, and that is the control: it does not rewrite its title, so itsargv[0]is the plain path/usr/local/sbin/slurmd, which*slurmdmatches.This is not about socket activation or a renamed binary. On the affected nodes a resident root listener exists (
PPID 1),pgrep -u root -x sshdfinds it, and bothssh.socketandssh.serviceare active. The process title alone accounts for the failure.Fix
Pass
-m '*sshd*'so the pattern tolerates the trailing colon.Verification
Two Ubuntu 24.04 nodes, OpenSSH_9.6p1 Ubuntu-3ubuntu13.19.
Before -- one failing check on each node:
After:
No node was left drained, and no other check changed behaviour.
🤖 Generated with Claude Code