I wanted to get linprocfs running on the dual opteron. I was setting up Cacti and a few of the features I am using requires access to linprocfs. First, let’s get the Linux Binary Compatibility:
# kldload linux kldload: can't load linux: File exists
Eh? Really?
# kldstat Id Refs Address Size Name 1 4 0xffffffff80100000 9795b8 kernel 2 1 0xffffffffbb3ca000 1402 fdescfs.ko 3 1 0xffffffffbb3cc000 8e5 pflog.ko 4 1 0xffffffffbb3cd000 2b914 pf.ko
Ahh, I must have it built in. Yes, I do. My kernel configuration file is:
include GENERIC ident OPTI options SMP options IPI_PREEMPTION options BREAK_TO_DEBUGGER options ALT_BREAK_TO_DEBUGGER # CR ~ ^b (solaris style)
And… well, GENERIC includes linux compat:
# grep -i linux GENERIC options COMPAT_43 # Needed by COMPAT_LINUX32 options COMPAT_LINUX32 # Compatible with i386 linux binaries # Linux 32-bit ABI support
Ahh, well, that’s not the problem. Let’s try mounting…. But first add the entry to /etc/fstab:
linprocfs /compat/linux/proc linprocfs rw 0 0
But first, make the directory:
mkdir -p /compat/linux/proc chmod -w /compat/linux/proc mount /compat/linux/proc
Then all is well.
Now, let’s run the script:
# perl /usr/local/share/cacti/scripts/linux_memory.pl MemFree cat: /proc/meminfo: No such file or directory
Well, that’s simple to fix (but don’t do this. see the comments):
[root@supernews:/] # ln -s /usr/compat/linux/proc /proc [root@supernews:/] # perl /usr/local/share/cacti/scripts/linux_memory.pl MemFree 8100616[root@supernews:/] #
Now let’s see that Cacti run…
[root@supernews:/] # ln -s /usr/compat/linux/proc /proc
Uhh, now this is TOTALLY HARMFULL thing to do. Think about programs that expect FreeBSD style proc in /proc …
Sounds like Cacti needs to be ported to use FreeBSD specific harvesting methods.
Just so long as I don’t use those FreeBSD programs…
I think it would be easier to patch the cacti scripts.
Pav: I think this patch does the trick: