User: Password:
Subscribe / Log in / New account

Magic filesystems are too clever

Magic filesystems are too clever

Posted Oct 30, 2009 10:15 UTC (Fri) by nix (subscriber, #2304)
In reply to: Magic filesystems are too clever by quotemstr
Parent article: /proc and directory permissions

Ew. No thanks. I find the /proc/$PID directories utterly crucial for all sorts of things. The problem with needing tools and sysctls to get at things is that they're not shell-compatible: you *must* write a tool to access it, and in extremis you can't do this because there isn't time; but you *can* cd into a directory and use ordinary shell tools. It's also crucial for non-emergency but adhoc stuff, which is a huge proportion of the stuff people actually do (as the non-adhoc stuff can be automated).

And for systems-administration stuff, well, am I the only person who's ever done a grep -R of /proc/sys/? Surely not.

Being shell-transparent is a huge huge huge feature. Don't break it.

Bringing up ps(1) as a counterargument is ridiculous: the reason ps(1) exists is both compatibility with Unix and that it can provide heaps of features that would be really annoying to implement by bashing on /proc yourself. But having /proc made ps(1) a hell of a lot easier to implement than it would have been otherwise (how else would you do it? grovelling through /dev/kmem, like traditional Unix? files in /proc with heaps of magic ioctl()s, like Solaris? Oh, please. We're moving *away* from that sort of opaque nightmare.)

(I'd actually quite like rm -r /proc/$PID to be made equivalent to kill -9, but I haven't implemented that or even tried to.)

(Log in to post comments)

Magic filesystems are too clever

Posted Oct 30, 2009 21:33 UTC (Fri) by foom (subscriber, #14868) [Link]

While I certainly agree that /proc/$PID is a useful feature...

> sysctls [...] not shell-compatible

Say what? "sysctl -w variable=value" is quite shell-friendly. For kernel *configuration*, I think the
sysctl interface made (and still makes!) a lot more sense than the 20 different mechanisms added
since then.

"sysctl -a | grep Whatever" is just as good -- perhaps even better -- than recursive grep against
/proc/sys, /sys/, and whatever the new-userspace-interface-of-the-month this month is...

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds