Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 85628 - sort order for "ps fax" reversed from procps-2.0.7-25
Summary: sort order for "ps fax" reversed from procps-2.0.7-25
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Public Beta
Classification: Retired
Component: procps
Version: phoebe
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Alexander Larsson
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-03-05 08:25 UTC by James Ralston
Modified: 2007-04-18 16:51 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-03-18 08:19:40 UTC


Attachments (Terms of Use)

Description James Ralston 2003-03-05 08:25:33 UTC
Description of problem:

Under Psyche, the default sort order for the ps command is numeric ascending, by
pid:

$ ps fax
  PID TTY      STAT   TIME COMMAND
    1 ?        S      0:04 init
    2 ?        SW     0:01 [keventd]
    3 ?        SW     0:00 [kapmd]
    4 ?        SWN    0:00 [ksoftirqd_CPU0]
    5 ?        SW     0:05 [kswapd]
    6 ?        SW     0:00 [bdflush]
    7 ?        SW     0:00 [kupdated]
    8 ?        SW     0:00 [mdrecoveryd]
   12 ?        SW     0:01 [kjournald]
   71 ?        SW     0:00 [khubd]
  231 ?        SW     0:00 [kjournald]
  232 ?        SW     0:00 [kjournald]
  233 ?        SW     0:01 [kjournald]
  774 ?        S      0:00 syslogd -a /var/lib/ntp/dev/log -m 0
  778 ?        S      0:00 klogd -x
  964 ?        S      0:02 named -u named -t /var/named
  986 ?        S      0:00 /usr/sbin/sshd
19463 ?        S      0:00  \_ /usr/sbin/sshd
19465 ?        S      0:00      \_ /usr/sbin/sshd
19467 ?        S      0:00          \_ /usr/X11R6/bin/xterm -ls
19471 pts/0    S      0:00              \_ -bash
19529 pts/0    R      0:00                  \_ ps fax
 1006 ?        SL     0:00 ntpd -p /var/run/ntp.pid -T /var/lib/ntp -U ntp
 1043 ?        S      0:00 crond
 1053 ?        S      0:00 cupsd
[...]

Under Phoebe 8.0.94, the default sort order is numeric descending, by pid:

$ ps fax
  PID TTY      STAT   TIME COMMAND
[...]
 4624 ?        S      0:01 xfs -droppriv -daemon
 4513 ?        S      0:00 cupsd
 4502 ?        S      0:00 crond
 4492 ?        S      0:00 sendmail: Queue runner@01:00:00 for /var/spool/clien
 4483 ?        S      0:00 sendmail: accepting connections
 4464 ?        SL     0:00 ntpd -p /var/run/ntp.pid -T /var/lib/ntp -U ntp -g
 4449 ?        S      0:00 /usr/sbin/sshd
 4436 ?        S      0:00 /usr/sbin/named -u named -t /var/named
 4383 ?        S      0:00 klogd -x
 4379 ?        S      0:00 syslogd -a /var/lib/ntp/dev/log -m 0 -r
 1298 ?        SW     0:00 [kjournald]
 1279 ?        SW     0:00 [kjournald]
 1254 ?        SW     0:00 [kjournald]
   74 ?        SW     0:00 [khubd]
   13 ?        SW     0:00 [kjournald]
    9 ?        SW     0:00 [mdrecoveryd]
    8 ?        SW     0:00 [kupdated]
    6 ?        SW     0:42 [kscand]
    5 ?        SW     0:00 [kswapd]
    7 ?        SW     0:01 [bdflush]
    4 ?        SWN    0:00 [ksoftirqd_CPU0]
    3 ?        SW     0:00 [kapmd]

Phoebe's behavior doesn't agree with what the man page says.

If this was a deliberate change (and not a bug), then I think it's
dumb--ordering by descending pid is a great way to ensure that the processes
that are left in my xterm after I run the ps command (e.g., bdflush, kjournald)
are ones I *don't* care about.

Version-Release number of selected component (if applicable):

procps-2.0.11-3 (Phoebe)

How reproducible:

Run "ps fax" on Phoebe.

Comment 1 Alexander Larsson 2003-03-11 13:46:37 UTC
This should be fixed in 2.0.11-6

Comment 2 James Ralston 2003-03-11 23:43:03 UTC
Are you certain?  Because at approximately 2003-03-11T18:00-0500 I downloaded
and installed:

ftp://ftp.redhat.com/pub/redhat/linux/rawhide/i386/RedHat/RPMS/procps-2.0.11-6.i386.rpm

$ rpm -q procps
procps-2.0.11-6

But "ps fax" still returns a descending sort order, instead of ascending.

Did I download the correct package?


Comment 3 Alexander Larsson 2003-03-13 09:06:02 UTC
Can you upgradet to the latest kernel to. There was some /proc changes in it.

I get:
# ps fax
  PID TTY      STAT   TIME COMMAND
    1 ?        S      0:04 init
    2 ?        SW     0:00 [keventd]
    3 ?        SW     0:00 [kapmd]
    4 ?        SWN    0:00 [ksoftirqd_CPU0]
    9 ?        SW     0:00 [bdflush]
    5 ?        SW     0:00 [kswapd]
    6 ?        SW     0:00 [kscand/DMA]
    7 ?        SW     0:00 [kscand/Normal]
    8 ?        SW     0:00 [kscand/HighMem]
   10 ?        SW     0:00 [kupdated]
   11 ?        SW     0:00 [mdrecoveryd]
   18 ?        SW     0:01 [raid5d]
   19 ?        SW     0:00 [kjournald]
   76 ?        SW     0:00 [khubd]
 2577 ?        SW     0:00 [kjournald]
 2578 ?        SW     0:00 [kjournald]
 2880 ?        S      0:00 /sbin/dhclient -1 -q -lf /var/lib/dhcp/dhclient-eth0.
 2931 ?        S      0:00 syslogd -m 0
 2935 ?        S      0:00 klogd -x
 2953 ?        S      0:00 portmap
 2972 ?        S      0:00 rpc.statd
 3038 ?        S      0:00 /usr/sbin/apmd -p 10 -w 5 -W -P /etc/sysconfig/apm-sc
 3087 ?        S      0:00 /usr/sbin/sshd
 3101 ?        S      0:00 xinetd -stayalive -reuse -pidfile /var/run/xinetd.pid
 3867 ?        S      0:00  \_ fam
 3137 ?        S      0:00 sendmail: accepting connections
 3146 ?        SW     0:00 sendmail: Queue runner@01:00:00 for /var/spool/client
 3156 ?        S      0:00 gpm -t imps2 -m /dev/mouse
 3166 ?        S      0:00 /usr/sbin/cannaserver -syslog -u bin
 3177 ?        S      0:00 crond
 3188 ?        S      0:00 cupsd
 3227 ?        S      0:00 /usr/bin/jserver
 3637 ?        S      0:00 xfs -droppriv -daemon
 3646 ?        SN     0:00 anacron -s
 3655 ?        S      0:00 /usr/sbin/atd
 3747 tty1     S      0:00 /sbin/mingetty tty1
 3748 tty2     S      0:00 /sbin/mingetty tty2
 3749 tty3     S      0:00 /sbin/mingetty tty3
 3750 tty4     S      0:00 /sbin/mingetty tty4
 3751 tty5     S      0:00 /sbin/mingetty tty5
 3752 tty6     S      0:00 /sbin/mingetty tty6
 3753 ?        S      0:00 /usr/bin/gdm-binary -nodaemon
 3796 ?        S      0:01  \_ /usr/bin/gdm-binary -nodaemon
 3797 ?        S      0:08      \_ /usr/X11R6/bin/X :0 -auth /var/gdm/:0.Xauth v
 3806 ?        S      0:34      \_ /usr/bin/gnome-session
 3849 ?        S      0:00          \_ /usr/bin/ssh-agent /etc/X11/xinit/Xclient
 3854 ?        S      0:02 /usr/libexec/gconfd-2 11
 3856 ?        S      0:00 /usr/libexec/bonobo-activation-server --ac-activate -
 3858 ?        S      0:01 /usr/bin/metacity --sm-client-id=default1
 3861 ?        S      0:02 gnome-settings-daemon --oaf-activate-iid=OAFIID:GNOME
 3872 ?        S      0:00 xscreensaver -nosplash
 3875 ?        S      0:02 gnome-panel --sm-client-id default2
 3877 ?        S      0:04 nautilus --no-default-window --sm-client-id default3
 3879 ?        S      0:00 magicdev --sm-client-id default4
 3881 ?        S      0:00 eggcups --sm-client-id default6
 3884 ?        S      0:00 pam-panel-icon --sm-client-id default0
 3887 ?        S      0:00  \_ /sbin/pam_timestamp_check -d root
 3886 ?        S      0:02 /usr/bin/python /usr/bin/rhn-applet-gui --sm-client-i
 3892 ?        S      0:00 /usr/libexec/notification-area-applet --oaf-activate-
 3897 ?        S      0:02 /usr/bin/gnome-terminal
 3898 ?        S      0:00  \_ gnome-pty-helper
 3899 pts/0    S      0:00  \_ bash
 3965 pts/0    R      0:00      \_ ps fax
 3963 ?        SW     0:00 [rpciod]
 3964 ?        SW     0:00 [lockd]


Comment 4 James Ralston 2003-03-18 08:19:40 UTC
Confirmed; the problem went away once I upgaded the kernel:

$ rpm -q kernel procps
kernel-2.4.20-2.54
procps-2.0.11-6

$ ps fax | head -10
  PID TTY      STAT   TIME COMMAND
    1 ?        S      0:07 init
    2 ?        SW     0:00 [keventd]
    3 ?        SW     0:00 [kapmd]
    4 ?        SWN    0:00 [ksoftirqd_CPU0]
    9 ?        SW     0:00 [bdflush]
    5 ?        SW     0:00 [kswapd]
    6 ?        SW     0:00 [kscand/DMA]
    7 ?        SW     0:17 [kscand/Normal]
    8 ?        SW     0:00 [kscand/HighMem]

Closing with RESOLVED RAWHIDE...



Note You need to log in before you can comment on or make changes to this bug.