Why is procfs deprecated in favor of procstat?

Jeremy Chadwick freebsd at jdc.parodius.com
Tue Feb 22 09:52:14 UTC 2011


On Tue, Feb 22, 2011 at 12:45:36AM -0800, Kelly Dean wrote:
> [ snipping stuff that I have no real response to :-) ]
>
> Jeremy, when you said procfs should be removed, did you mean just for
> the same reasons Oliver said, or did you have other reasons?

The security issues are long-standing and there have been many over the
years, but the real reason is something that's less evident (or at least
less directly apparent):

Simply put, procfs on FreeBSD has been neglected.  There isn't a lot of
attention being given to it, and the only modifications in recent
months/years have been generally minor compared to the rest of the tree.
You can review some of the commits yourself:

http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/fs/procfs/

Others like yourself have asked what the state of procfs is, going back
as far as 2005.  Be sure to read the reply as well:

http://unix.derkeiler.com/Mailing-Lists/FreeBSD/questions/2005-05/2607.html

There was also a commit comment circa 2008 to the RELENG_7 branch that
indicates procfs is "now-deprecated":

http://freshbsd.org/2008/04/10/20/54/02

...yet there have been commits as recent as 2009 to fix important
utilities -- gcore(1) and gdb(1) -- to work without procps, which adds
further evidence that procfs may have been hastily forgotten/dropped
without a full review of what relied upon it:

http://freshbsd.org/2009/12/19/19/30/27

Alternate solutions or changes to procfs have been mentioned over the
years, such as in 2008 by a user on freebsd-arch, who received no reply:

http://lists.freebsd.org/pipermail/freebsd-arch/2008-March/007750.html

Finally, there is an official maintainer of procfs (see procfs.c at the
first link, then look for the Sep 23 2009 commit).  You may want to
privately ask that individual what the current state of affairs is.

The /sysctl filesystem idea I've had I still feel is the best solution,
but *should not* be based on the procfs code (they're two different
beasts, despite having similar functionality).  It should be written
from scratch.

I was quite serious when I said I wish I could write such a thing,
because the benefits of such are huge, especially when it comes to *any*
form of counter/statistic-gathering or monitoring capability on FreeBSD.
Honestly, it's a project that seems perfect for GSoC.

-- 
| Jeremy Chadwick                                   jdc at parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                  Mountain View, CA, USA |
| Making life hard for others since 1977.               PGP 4BD6C0CB |



More information about the freebsd-fs mailing list