[KLUG Programming] Pthreads problem

Adam Williams programming@kalamazoolinux.org
Sun, 04 Jan 2004 13:10:18 -0500


> >> Maybe you only intend to use it for online hacking; perhaps it's time
> >> to get into the habit of using sysctl there, too...
> >I'm very curious to know where you and Adam got this misinformation that
> >` echo > /proc/something ` is a menace to users everywhere.
> Now, now, let's not blow this thing outta proportion. I don't think it's a
> "menace to users everywhere", but I do know that if it were to ever change,
> it's one of those time killer maintenance tasks that NO ONE will understand, 
> unless they know the systems really well.

Yep, and easy to overlook/forget.  Shoot... I usually forget to edit
/etc/sysctl.conf when I first bring a server online;  now you want to to
update a bunch of echo command and shell scripts?  No thanks.  Every
single thing I can set-and-forget is precious.

> I'm sure Adam (who is ,as far as I can tell, is not burdened by an excess of 
> reticence) will tell you his reasons.

Thats me, Mr. Reticence. :)

> >Now, for the record, let's review the difference between sysctl and
> >`echo > /proc/something `:
> >1. sysctl will work whether /proc is mounted or not.
> >2. (This space left intentionally blank.)
> I'll fill this one in for you. 
> I don't have bad things to say about /proc, and I probably won't have 
> bad things to say about the successor to /proc, whatever that is going
> to be.  I don't think /proc is a bad abstraction itself, and the notion
> that regular unix-like tools will work on a lot of /proc does have a 
> certain kind of charm.

I don't have anything against /proc either; it works, and probably the
best abstraction of low level gunk I've seen.  My only grip would be
thats its a filesystem - i'd prefer something more directory-ish and
network aware.

> So the second reason is that sysctl, like setkernel, normalizes syntax, and as 
> a result makes stuff easier to maintain. I can replace it easily. I can also 
> use it to protect the system from someone placing dumb values into some 
> pretty sensitive places, by making setkernel a bit less trivial.

Exactly.  Replacability is good.  You could even give attributes more
meaningful names than fs.file-max or (many worse potential examples). 
But that would really be something a distrobution maintainer should look
into.