[Mellanox] mlnx-fw-manager.service: escape backslashes in ExecCondition to silence systemd parser warning#27742
Open
yizhenzha wants to merge 1 commit into
Open
Conversation
PR sonic-net#26549's ExecCondition uses '\<...\>' word anchors. systemd treats '\' as an escape and warns on every boot/reload, polluting syslog. Double the backslashes ('\\<...\\>') so systemd passes literal '\<' / '\>' to grep. Parsed argv[] is byte-identical; behavior unchanged. Signed-off-by: Yizhen Zhang <evazha@nvidia.com>
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
oleksandrivantsiv
approved these changes
Jun 5, 2026
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.
Why I did it
https://github.com/sonic-net/sonic-buildimage/pull/26549added anExecConditiontoplatform/mellanox/files/mlnx-fw-manager.service:systemd's unit-file parser treats
\as an escape character and does not recognize\<or\>, so on every boot and on everysystemctl daemon-reloadit logs the following warning, polluting syslog:How I did it
ExecConditionso that systemd hands the literal\</\>word-boundary anchors through togrep:\\is a documented systemd escape that resolves to a single\, so theargv[]passed to/bin/grepis byte-identical to the previous version. Only the parser warning is removed; runtime behavior is unchanged.How to verify it
Additional checks performed on the same DUT (parity / no behavior change):
systemctl show mlnx-fw-manager.service -p ExecConditionfor OLD and NEW produces a byte-identicalargv[](/bin/grep -qv \<SONIC_BOOT_TYPE=fastfast\> /proc/cmdline);diffof the two outputs is empty.systemctl start mlnx-fw-manager.servicereportsResult=success,ConditionResult=yes,ActiveState=active,SubState=exitedwith both forms.grep -qvregression with the parsed pattern returns1 / 0 / 0 / 0for cmdlinesSONIC_BOOT_TYPE=fastfast/=fast/=fastfastX/no_match_hereunder both forms — word-boundary semantics preserved.Which release branch to backport (provide reason below if selected)
(Backport is only relevant to branches that already carry PR #26549. Tick the matching release branches if needed.)
Description for the changelog
[mellanox] Fix systemd "Ignoring unknown escape sequences" warning in
mlnx-fw-manager.serviceby doubling the backslashes in theExecConditionword-boundary anchors.Summary by CodeRabbit