Someone on IRC was kind enough to provide me with an account on an OpenBSD machine so I could toy with porting some of my code. I decided to start with reading process information.
Things haven't worked out so well. Some admins unmount/proc (or never mount it in the first place) as a security precaution. I'm not sure what this protects the system from given that ps is still available, but then I'm not a hacker.
So, reading from/proc is out. The next plan was to use the kvm libs, which looked simple enough. Unfortunately, attempting to use kvm_open() fails with "/dev/mem: Permission denied". So, if an admin is security conscious enough to disable/proc, they're probably going to prevent the use of kvm as well.
What I don't know is whether or not this is a typical setup for OpenBSD. I can always resort to parsing 'ps' - NOT.
Without looking, my guess would be that it uses the kvm libs. However, ps (and most of your other installed programs) run suid root, so it *does* have permission to read/dev/mem.
I would have thought that most BSDs use -lkvm, plus setgid kmem or something. I have a feeling that newer FreeBSD uses sysctl however. Yup, libkvm appears to do that.
Don't forget that BSD ps also doesn't/proc so that you can get ps to run over a crashdump image.
It exists in the BSD family but it's often not mounted by BSD admins, which probably led you to believe that. Also, Solaris has/proc, but it's not in plain text format. Of the *nix flavors that I've seen so far, only HP-UX doesn't have a proc filesystem, but I certainly haven't seen them all.
OK, I overstepped by saying "BSD family". But it is specifically not in OpenBSD, hence the subject of this post and the previous replies. There's no manpage for it. There's no option to "mount" it by the "admin". It doesn't exist.
Yes and no. It *can* exist. It seems (so the guy who gave me the account tells me) that you have to create a/proc partition (and give it a bit of space), then mount it.
Anyway, I have an account on an OpenBSD box and I can see process info under/proc now.
Use the source, Luke (Score:4, Informative)
-sam
Reply to This
Re:Use the source, Luke (Score:2)
Re:Use the source, Luke (Score:2)
Don't forget that BSD ps also doesn't /proc so that you can get ps to run over a crashdump image.
-Dom
No /proc on OpenBSD (Score:3, Informative)
Reply to This
Re:No /proc on OpenBSD (Score:2)
Re:No /proc on OpenBSD (Score:2)
Re:No /proc on OpenBSD (Score:2)
Re:No /proc on OpenBSD (Score:2)
Anyway, I have an account on an OpenBSD box and I can see process info under /proc now.
Re:No /proc on OpenBSD (Score:1)