Skip to content

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

Open
mconcas wants to merge 1 commit into
AliceO2Group:masterfrom
mconcas:fix-rhel10-ps
Open

mconcas wants to merge 1 commit into
AliceO2Group:masterfrom
mconcas:fix-rhel10-ps

Conversation

@mconcas

@mconcas mconcas commented Oct 23, 2026

Copy link
Copy Markdown

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.
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.

1 participant