About compatibility

POSIX, Linux, Solaris systems have -A parameter for ps command.
Only OpenWRT not.

Ok, OpenWRT no needs to -A parameter. But why ps -A close with error? Do I need to rewrite all shell script for OpenWRT especially?

OpenWrt routers typically have limited flash space, so most of the typical helper applications are provided by the size optimized busybox. Its apps may have somewhat limited functionality.

If you need full apps, they are typically provided as add-on packages, like coreutils etc. I think that procps-ng has also the full-scale ps


You don't quite understand my message.

Well I think the message was clearly understood.

You asked

And the answer is that the ps version in Openwrt is using the version from busybox by default to save space. And that version will say that -A is unrecognized.
If your script require that option then you would need to install the full feature version of ps as indicated.



Because the -A is not supported. Or do you think that any unrecognised option should just be ignored?

root@router1:~# ps -A
ps: unrecognized option: A
BusyBox v1.33.0 () multi-call binary.

Usage: ps

Show list of processes

        w       Wide output

Yes, I think that unsupported options must be ignored.
-A must be allowed on POSIX-compatible system.

Well, who said that busybox is fully POSIX compliant?


You are raising an issue about BusyBox behavior.
The proper place to report this kind of issue is here:


Isn't that OpenWRT has own edition of BusyBox?

OpenWrt relies on the upstream:

So, you should first file a ticket on the upstream bug tracker.
OpenWrt devs are unlikely bored enough to patch external project such as BusyBox for no valid reason.


No, you do not, like @hnyman mentioned run: opkg update; opkg install procps-ng-ps;. You might want to insert a line at the top of the script to ensure that procps-ng-ps is installed on OpenWrt:

if [ ! -x /bin/procps-ng-ps ]; then opkg update; opkg install procps-ng-ps; fi

This is monumentally bad, silent failures are always bad because you don't know what fails until you run a lengthy debug process.
Most commands will return an error if called with wrong (or missing) arguments.

POSIX is not enforced by anyone so projects may or may not support it. Welcome to software development


To be fair, there are other BusyBox applets which silently ignore unsupported options.
So the actual behavior is certainly inconsistent depending on a specific applet and option.

does not change what I said, anyone that thinks unsupported options must be ignored is wrong and causing immesurable amounts of grief to anyone else that will develop on the same system for years to come.


Immesurable amounts of grief causing that who generates meaningless dialects of the centuries established structures.

Specifically: on Bysybox ps m same as ps -A m on all unix and Linux, except freebsd. Why on Busybox ps -A m close with the error instead silently run ps m?

A wrong old tradition is still wrong, and I'm not more inclined to agree with it.

OpenWrt is just packaging their tool in the system, we don't know.

You need to ask/complain to Busybox developers, as this was their choice. https://busybox.net/lists.html

1 Like

Somehow OpenWrt (and other busybox using environments) has managed to survive 17 years without an implementation for ps -A, so there must be a life without it…