BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005034 [BusyBox] Standards Compliance major always 09-17-08 12:28 09-28-08 16:23
Reporter path0s View Status public  
Assigned To BusyBox
Priority normal Resolution no change required  
Status closed   Product Version 1.12.x
Summary 0005034: PS: Commandline options to PS cause major problems from scripts
Description When existing scripts pass commandline options to PS it causes major problems for those scripts. A lot of scripts use switches such as -e and -aux to figure out what processes are running by whom in order to check to see if things are running and to control those processes.

If the real functionality of the standard switches to PS can't be used in busybox, at least make busybox ignore the switches and just output the same info it does normally without throwing the illegal option.
Additional Information
Attached Files

- Relationships

- Notes
(0011564)
vda
09-17-08 18:09

Actually, ps has WILDLY different switches in different Unixes, to the point that POSIX had hard time finding a common subset.

It proved impossible, thus many switches are not documented in POSIX. This is what _is_ documented according to my POSIX manpage:

PS(P) POSIX Programmer's Manual PS(P)
NAME
       ps - report process status
SYNOPSIS
       ps [-aA][-defl][-G grouplist][-o format]...[-p proclist][-t termlist]
       [-U userlist][-g grouplist][-n namelist][-u userlist]
       -a Write information for all processes associated with terminals.
              Implementations may omit session leaders from this list.
       -A Write information for all processes.
       -d Write information for all processes, except session leaders.
       -e Write information for all processes. (Equivalent to -A.)
       -f Generate a full listing. (See the STDOUT section for the con-
              tents of a full listing.)
...
       -u userlist
              Write information for processes whose user ID numbers or login
              names are given in userlist.
...

As you see, "ps -aux" is not POSIX-compliant, even "ps -au" is not.

But POSIX does have a nice way to output exactly those columnts you want - it's "-o format" option. That is the way to use ps portably.

If you have cases where busybox ps contradicts POSIX/SUSv3, that is a real problem.
 
(0011574)
path0s
09-17-08 19:59

Well, I'm on a uclibc/busybox based ARM install (western digital mybookworld) that used to have many commandline switches to it's old busybox PS command. I upgraded busybox to 1.12 and now quite a few of the scripts are broke because PS no longer supports any switch besides 'w' and throws an error:

[root@MyBookWorld ~]# ps -e
ps: illegal option -- e
BusyBox v1.12.0 (2008-09-01 00:36:05 CDT) multi-call binary

Usage: ps

Report process status

Options:
        w Wide output

[root@MyBookWorld ~]#
 
(0011634)
vda
09-18-08 15:58

ps.c has "big" implementation conditionalized on CONFIG_DESKTOP=y, try it.
Supported options: -ZaAdefl -o col1,col2,col3=header
 
(0011644)
path0s
09-18-08 19:31

Ahh very good, thank you. Had no idea that the desktop option would affect small things such as PS.. Sorry to of filed a bug about this, I looked as much as I could.. I swear :)

Consider this closed.
 

- Issue History
Date Modified Username Field Change
09-17-08 12:28 path0s New Issue
09-17-08 12:28 path0s Status new => assigned
09-17-08 12:28 path0s Assigned To  => BusyBox
09-17-08 18:09 vda Note Added: 0011564
09-17-08 19:59 path0s Note Added: 0011574
09-18-08 15:58 vda Note Added: 0011634
09-18-08 19:31 path0s Note Added: 0011644
09-28-08 16:23 vda Status assigned => closed
09-28-08 16:23 vda Resolution open => no change required


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker