lm-sensors `sensors -s` fails with "Can't access procfs/sysfs for writing" on gentoo-sources but not vanilla-sources. I'm using i2c and lm-sensors version 2.8.7, and have also tried with version 2.8.1, and also with kernels 2.4.25 and 2.4.26. (I've built a lot of kernels today to test this.) I noticed that the lckbase patch in the 2.4.26 Gentoo patchset made some changes to a couple of the i2c modules, so I tried building a version of i2c with those patches, but it didn't make any difference. Reproducible: Always Steps to Reproduce: 1.emerge gentoo-sources (currently, latest is 2.4.26-r7), build a kernel, reboot 2.emerge i2c lm-sensors 3./etc/init.d/lm_sensors start Actual Results: The "Initializing sensors" line shows [!!] and subsequently trying `sensors -s` says "Can't access procfs/sysfs for writing, Run as root?" (obviously while logged in as root). Of course this causes the sensors readings to be wrong, as the various compute and other statements in /etc/sensors.conf have been ignored. Expected Results: Correct startup, as under vanilla-sources, and correct sensors readings. Portage 2.0.50-r9 (default-x86-2004.0, gcc-3.3.3, glibc-2.3.3.20040420-r0, 2.4.26) ================================================================= System uname: 2.4.26 i686 VIA Nehemiah Gentoo Base System version 1.4.16 distcc 2.13 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] Autoconf: sys-devel/autoconf-2.59-r4 Automake: sys-devel/automake-1.8.3 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=pentium3 -O2 -pipe -fomit-frame-pointer -falign-functions" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/bind /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=pentium3 -O2 -pipe -fomit-frame-pointer -falign-functions" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS="http://www.mirror.ac.uk/sites/www.ibiblio.org/gentoo/ http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j1" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="X aalib alsa apache2 apm arts atm avi berkdb bonobo cdr crypt cups dga dvd emacs encode esd foomaticdb gd gdbm gif gnome gpm gtk gtk2 imap imlib java jikes jpeg ldap libg++ libwww mad mikmod mmx mozilla mpeg mysql ncurses nls oggvorbis opengl oss pam pcmcia pdflib perl png python quicktime readline samba sasl sdl slang spell sse ssl svga tcpd tiff transcode truetype usb x86 xml xml2 xmms xosd zlib" I have a VIA Epia motherboard with a vt1211 sensor, if it makes any difference.
The I2C layer isn't compatible; 2.8 is for 2.6 kernels. Try i2c and lm-sensors 2.6.5 and totally disable I2C support in your kernel if any is present. Tell me if you still have problems when trying that.
No, 2.6.5 doesn't work either, gives the same problem. In fact i2c/lm-sensors 2.8.x do work on 2.4 kernels - there's lots in the ebuilds to make sure they do - just not on gentoo-sources kernels.
Can you attach your .config please?
Created attachment 37020 [details] My .config for gentoo-sources-2.4.26-r7 Yes I know I have CONFIG_I2C=m but according to the sys-apps/i2c ebuild that's OK. I don't use any of the other I2C-dependent modules.
Created attachment 37021 [details] My .config for vanilla-sources-2.4.26
Hm, the configs look good - can you please attach the file made by "strace -o $file sensors -s", you might need to merge strace if you do not already have it. Thanks!
OK hope these help, when I decided to try vanilla-sources-2.4.26 I copied my .config from /usr/src/linux-2.4.26-gentoo-r7 to /usr/src/linux-2.4.26 and said `make oldconfig` -- the second attachment is the result of that -- then went straight to `make dep && make bzImage modules modules_install install`, rebooted, `emerge =i2c-2.8.7 =lm-sensors-2.8.7` and found that `sensors -s` works under the vanilla kernel where it didn't under the similarly-configured Gentoo kernel. Well that was a near-collision, thought I'd post this note anyway just in case it was of any use; strace is emerging now.
Created attachment 37023 [details] strace output This is the output of `strace -o sensors.strace sensors -s` run as root with kernel 2.4.26-gentoo-r7 and i2c/lm-sensors 2.8.7.
Is this of any interest: out root # ls -l /proc/sys/dev/sensors/vt1211-isa-6000 total 0 -r--r--r-- 1 root root 0 Aug 8 14:41 alarms -rw-r--r-- 1 root root 0 Aug 8 14:41 fan1 -rw-r--r-- 1 root root 0 Aug 8 14:41 fan2 -rw-r--r-- 1 root root 0 Aug 8 14:41 fan_div -rw-r--r-- 1 root root 0 Aug 8 14:41 in0 -rw-r--r-- 1 root root 0 Aug 8 14:41 in1 -rw-r--r-- 1 root root 0 Aug 8 14:41 in2 -rw-r--r-- 1 root root 0 Aug 8 14:41 in3 -rw-r--r-- 1 root root 0 Aug 8 14:41 in4 -rw-r--r-- 1 root root 0 Aug 8 14:41 in5 -rw-r--r-- 1 root root 0 Aug 8 14:41 pwm1 -rw-r--r-- 1 root root 0 Aug 8 14:41 pwm2 -rw-r--r-- 1 root root 0 Aug 8 14:41 temp2 -rw-r--r-- 1 root root 0 Aug 8 14:41 temp3 -rw-r--r-- 1 root root 0 Aug 8 14:41 temp4 -rw-r--r-- 1 root root 0 Aug 8 14:41 temp5 -rw-r--r-- 1 root root 0 Aug 8 14:41 temp6 -rw-r--r-- 1 root root 0 Aug 8 14:41 temp7 -rw-r--r-- 1 root root 0 Aug 8 14:41 uch_config -r--r--r-- 1 root root 0 Aug 8 14:41 vid -rw-r--r-- 1 root root 0 Aug 8 14:41 vrm out root # ls -ld /proc/sys/dev/sensors/vt1211-isa-6000 dr-xr-xr-x 2 root root 0 Aug 8 14:41 /proc/sys/dev/sensors/vt1211-isa-6000 out root # chmod u+w /proc/sys/dev/sensors/vt1211-isa-6000 out root # echo $? 0 out root # ls -ld /proc/sys/dev/sensors/vt1211-isa-6000 dr-xr-xr-x 2 root root 0 Aug 8 14:42 /proc/sys/dev/sensors/vt1211-isa-6000 out root #
Created attachment 37030 [details] strace output when it works (vanilla kernel) Output from `strace -o sensors-ok.strace sensors -s` under (vanilla) 2.4.26 kernel and i2c/lm-sensors 2.8.7, just in case seeing the difference helps...
Hm, it's a bug in GRSecurity [ Gentoo bug #26244 for a reference from gentoo-sources-2.4.20 ] that's still around today which happens when you have GRSecurity disabled - please try this patch and tell me if it works - if everything is good then I'll send it upstream.
Created attachment 37032 [details, diff] Patch
Woo hoo! Thanks for that, plasmaroo (or should I call you Tim?), it works for me now. Depressing, though, to think that a daft bug like this that was already fixed 11 months ago has reappeared. I think the same problem applies to all gentoo-sources 2.4.25 and 2.4.26, I haven't tried anything older. Anyway, thanks again!
Patch in gentoo-sources-2.4.27-r1 which should reach the rsync servers shortly. If you still have any issues then please reopen this bug. Thanks!