Subject: Re: ps vs /proc
To: None <current-users@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: current-users
Date: 02/24/2000 01:22:25
>> I still think ps should be less stringent about what it demands of
>> /proc before it's willing to give it the benefit of the doubt.
> Look at the threads in tech-userlevel from March 1999, when I first
> committed the ps /proc fallback.  :)

Okay, another one for the private patch tree.  Sigh.

> I got the feeling at that time from the discussions that it was
> better to give no information than possibly-erroneous information.

I strongly disagree, because this leaves me with no way to get a
process listing better than "cat /proc/*/status".

> % ps ax
> ps: proc size mismatch (24192 total, 744 chunks).
> ps: /proc exists but does not have a procfs mounted on it.
> ps: fallback /proc-based lookup also failed.  Giving up...  

> Hm.  Line 223 of procfs_ops.c does a strcmp of the returned
> f_fstypename against MOUNT_PROCFS (defined in
> /usr/include/sys/mount.h), which is what failed.  It might be
> interesting, if you haven't already upgraded the whole system, to
> have the warning print out what kind of filesystem it _thinks_ it is.
> It'll probably just be "ocfs" or "fs"...  :)

Does this help?

[Truly-Delicious - root] 28> df
Filesystem  1024-blocks     Used    Avail Capacity  Mounted on
/wd0a          10786456  2339952 11731952    16%    
                      0        0        0    99%    
                      0        0        0     0%    
                      0        0        0 16268798%    
[Truly-Delicious - root] 29> ps ax
ps: proc size mismatch (24948 total, 744 chunks).
ps: /proc exists but does not have a procfs mounted on it.
ps: fallback /proc-based lookup also failed.  Giving up...
[Truly-Delicious - root] 30> mount
/wd0a on  type  (mounted by 20480)
 on  type  (local)
 on  type  (synchronous)
 on  type /dev
[Truly-Delicious - root] 31> 

And yes, there is in fact a procfs mounted on /proc.  I haven't touched
the mounts since boot, and fstab says

/dev/wd0a /        ffs    rw       1 1
/dev/wd0b swap     swap   sw       0 0
procfs    /proc    procfs rw       0 0
kernfs    /kern    kernfs rw       0 0
fdesc     /dev     fdesc  ro,union 0 0

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B