Skip to content

OCTRL-1107: [shmcleaner] Read process names from /proc instead of ps - #870

Merged
justonedev1 merged 1 commit into
AliceO2Group:masterfrom
mconcas:fix-rhel10-ps
Oct 26, 2026
Merged

justonedev1 merged 1 commit into
AliceO2Group:masterfrom
mconcas:fix-rhel10-ps

Conversation

@mconcas

@mconcas mconcas commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

The o2-alf exclusion compares the output of ps -ho %c <pid> with the literal string o2-alf. On RHEL 10 that command pads the name to 15 columns, so the comparison never matches and the cleanup SIGTERMs ALF before every DEPLOY. systemd treats SIGTERM as a clean exit and Restart=on-failure leaves the service down. EL9 prints the bare name, which is why production was not affected.

Read /proc/<pid>/comm directly: same kernel field, no dependency from ps invocation and params combination.

On rhel9:

[flp-node-rhel9]$ p=$(pgrep -u flp -f /opt/o2/bin/o2-alf)
ps -o comm= $p | od -c
LANG=C ps -ho %c $p | od -c
0000000   o   2   -   a   l   f  \n
0000007
0000000   o   2   -   a   l   f  \n
0000007

On rhel10:

[flp-node-rhel10]# p=$(pgrep -u flp -f /opt/o2/bin/o2-alf)
ps -o comm= $p | od -c
LANG=C ps -ho %c $p | od -c
0000000   o   2   -   a   l   f  \n
0000007
0000000   o   2   -   a   l   f                                      \n
0000020

The o2-alf exclusion compares the output of `ps -ho %c <pid>` with the
literal string `o2-alf`. On RHEL 10 that command pads the name to 15 columns, so the comparison never matches and the cleanup SIGTERMs ALF before every DEPLOY. `systemd` treats SIGTERM as a clean exit and `Restart=on-failure` leaves the service down. EL9 prints the bare name, which is why production was not affected.

Read `/proc/<pid>/comm` directly: same kernel field, not intermediate.
@justonedev1

Copy link
Copy Markdown
Collaborator

oh, wow... good catch.

@justonedev1
justonedev1 merged commit 993b3ee into AliceO2Group:master Oct 26, 2026
5 checks passed
@mconcas
mconcas deleted the fix-rhel10-ps branch October 26, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants