Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 59708 - lm-sensors `sensors -s` fails with "Can't access procfs/sysfs for writing" on gentoo-sources but not vanilla-sources
Summary: lm-sensors `sensors -s` fails with "Can't access procfs/sysfs for writing" on...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Tim Yamin (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-07 09:03 UTC by John Robinson
Modified: 2004-08-24 08:11 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
My .config for gentoo-sources-2.4.26-r7 (.config,32.54 KB, text/plain)
2004-08-08 06:07 UTC, John Robinson
Details
My .config for vanilla-sources-2.4.26 (.config,31.09 KB, text/plain)
2004-08-08 06:08 UTC, John Robinson
Details
strace output (sensors.strace,9.02 KB, text/plain)
2004-08-08 06:33 UTC, John Robinson
Details
strace output when it works (vanilla kernel) (sensors-ok.strace,8.43 KB, text/plain)
2004-08-08 06:56 UTC, John Robinson
Details
Patch (gentoo-sources-2.4.26-r7-59708.patch,646 bytes, patch)
2004-08-08 07:09 UTC, Tim Yamin (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Robinson 2004-08-07 09:03:23 UTC
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.
Comment 1 Tim Yamin (RETIRED) gentoo-dev 2004-08-08 03:36:04 UTC
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.
Comment 2 John Robinson 2004-08-08 05:55:58 UTC
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.
Comment 3 Tim Yamin (RETIRED) gentoo-dev 2004-08-08 05:56:50 UTC
Can you attach your .config please?
Comment 4 John Robinson 2004-08-08 06:07:18 UTC
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.
Comment 5 John Robinson 2004-08-08 06:08:15 UTC
Created attachment 37021 [details]
My .config for vanilla-sources-2.4.26
Comment 6 Tim Yamin (RETIRED) gentoo-dev 2004-08-08 06:11:53 UTC
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!
Comment 7 John Robinson 2004-08-08 06:15:12 UTC
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.
Comment 8 John Robinson 2004-08-08 06:33:16 UTC
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.
Comment 9 John Robinson 2004-08-08 06:39:14 UTC
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 #
Comment 10 John Robinson 2004-08-08 06:56:03 UTC
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...
Comment 11 Tim Yamin (RETIRED) gentoo-dev 2004-08-08 07:09:06 UTC
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.
Comment 12 Tim Yamin (RETIRED) gentoo-dev 2004-08-08 07:09:28 UTC
Created attachment 37032 [details, diff]
Patch
Comment 13 John Robinson 2004-08-08 08:21:41 UTC
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!
Comment 14 Tim Yamin (RETIRED) gentoo-dev 2004-08-24 08:11:18 UTC
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!