Skip to content

[OpenWrt] Fix BusyBox ps unsupported flags#1621

Open
macie wants to merge 2 commits intoCISOfy:masterfrom
macie:busybox-ps
Open

[OpenWrt] Fix BusyBox ps unsupported flags#1621
macie wants to merge 2 commits intoCISOfy:masterfrom
macie:busybox-ps

Conversation

@macie
Copy link
Contributor

@macie macie commented Mar 23, 2025

Errors /bin/ps: unrecognized option: a and /bin/ps: unrecognized option: x blocks multiple tests.

This is a part of enabling support for OpenWrt, see: #1600.

(more details in commit messages)

macie added 2 commits March 23, 2025 21:54
Command `ps ax | grep '<WORD1>|<WORD2>' | grep -v 'grep'` can be directly
transformed to `IsRunning '<WORD1>' || IsRunning '<WORD2>'`.

`IsRunning` supports BusyBox `ps` (without `-ax` option, see: <https://github.com/mirror/busybox/blob/master/procps/ps.c>).
BusyBox not implements flags `-ax` (see: <https://github.com/mirror/busybox/blob/master/procps/ps.c>)
Calling it throws an error: `/bin/ps: unrecognized option: a`.

`IsRunning` function cannot be used here due to complex searching rules.
@macie macie mentioned this pull request Mar 23, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant