Ticket #2199 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

Wrong path to i2cdetect on fc6

Reported by: lm-sensors@… Owned by: khali
Priority: major Milestone: 2.10.4
Component: interface Version: 2.10.1
Keywords: Fedora Core 6, i2cdetect, sensors-detect Cc:


I tried to use sensors-detect to detect and load the modules required for sensors on my mother board.

Let me quote the complete output of running ./sensors-detect from /usr/sbin/

# sensors-detect revision 4171 (2006-09-24 03:37:01 -0700)

This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.

We can start with probing for (PCI) I2C or SMBus adapters.
Do you want to probe now? (YES/no): yes
Probing for PCI bus adapters...
Use driver `i2c-viapro' for device 0000:00:11.0: VIA Technologies VT8237 South Bridge

We will now try to load each adapter module in turn.
Module `i2c-viapro' already loaded.
If you have undetectable or unsupported adapters, you can have them
scanned by manually loading the modules before running this script.

We are now going to do the I2C/SMBus adapter probings. Some chips may
be double detected; we choose the one with the highest confidence
value in that case.
If you found that the adapter hung after probing a certain address,
you can specify that address to remain unprobed.
Can't exec "i2cdetect": No such file or directory at ./sensors-detect line 5320, <STDIN> line 1.
Couldn't find i2cdetect program!! at ./sensors-detect line 5320, <STDIN> line 1.

Then I opened /usr/sbin/sensors-detect for editing and suspected bellow lines to be the culprit.

# Same for /usr/local/sbin since we need i2cdetect which is installed there
# by default (reported by Lennard Klein)
$ENV{PATH} = '/usr/local/sbin:'.$ENV{PATH}
        unless $ENV{PATH} =~ m,(^|:)/usr/local/sbin/?(:|$),;

Changed it to...

# Same for /usr/local/sbin since we need i2cdetect which is installed there
# by default (reported by Lennard Klein)
$ENV{PATH} = '/usr/sbin:'.$ENV{PATH}
        unless $ENV{PATH} =~ m,(^|:)/usr/sbin/?(:|$),;

and all worked fine.

I'm using Fedora Core 6. I installed lm_sensors package that came with the images and upgraded to 2.10.1-1 (yum update lm_sensors) before running sensors-detect.

I suspect that in some distros i2cdetect is located in /usr/local/sbin/, but not the case with Fedora Core 6.

To my belief sensors-detect should check whether i2cdetect exist in /usr/local/sbin/, if it doesn't /usr/sbin/, and any other location that any other distro might put i2cdetect.

I'm not saying the defect lies in your part, could be a defect introduced by the distro but a suggesting an improvement.

Great project, now I get to see how at what temperature my processor is running, thanks.

Change History

Changed 7 years ago by khali

  • status changed from new to assigned
  • reporter changed from ticket to lm-sensors@…
  • cc lm-sensors@… removed
  • priority changed from blocker to major
  • milestone set to 2.10.4
  • owner changed from somebody to khali

Changed 7 years ago by khali

  • status changed from assigned to closed
  • resolution set to fixed

This is essentially a packaging problem, sensors-detect expects i2cdetect to be installed with the rest of the lm-sensors package in /usr/local/bin, but distributions install it in /usr/bin instead. Most distributions (Slackware, Suse...) update sensors-detect accordingly in their lm-sensors package, Fedora Core should have done the same.

However I have to admit that lm-sensors isn't exactly packager-friendly, so it's only fair that we try to help here. I've modified sensors-detect so that it adds all of /sbin, /usr/local/sbin and /usr/sbin to the PATH if needed. This should solve the problem.

Note: See TracTickets for help on using tickets.