Re: lmsensors doesn't detect core-i7 sensors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>The current text is quite absolute ("Copy prog/init/lm_sensors.init to /etc/init.d/lm_sensors")
>and really invites users to overwrite the distribution specific scripts.

 

I really did that. See:

mahmood@localhost:~$ cat /etc/init.d/lm-sensors
#!/bin/sh
#
# chkconfig: - 26 74
# description: sensors is used for monitoring motherboard sensor values.
# config: /etc/sysconfig/lm_sensors
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#    MA 02110-1301 USA.

# See also the lm_sensors homepage at:
#    
http://www.lm-sensors.org

# It uses a config file /etc/sysconfig/lm_sensors that contains the modules
# to be loaded/unloaded. That file is sourced into this one.

# The format of this file is a shell script that simply defines variables:
# HWMON_MODULES for hardware monitoring driver modules, and optionally
# BUS_MODULES for any required bus driver module (for example for I2C or SPI).

PSENSORS=/usr/local/bin/sensors

if [ ! -x $PSENSORS ]; then
        PSENSORS=/usr/bin/sensors
fi

# Source function library.
. /etc/init.d/functions

RETVAL=0
prog="lm_sensors"

# This functions checks if sensor support is compiled into the kernel, if
# sensors are configured, and loads the config file
check_sensors() {
        CONFIG=/etc/sysconfig/lm_sensors
        if ! [ -r "$CONFIG" ] || ! grep '^HWMON_MODULES' $CONFIG >/dev/null 2>&1; then
                echo -n "$1 $prog: not configured, run sensors-detect"
                echo_warning
                echo
                exit 6
        fi

        # Load config file
        . "$CONFIG"
}

start() {
        check_sensors "Starting"

        echo -n "Starting $prog: loading module "

        for module in $BUS_MODULES $HWMON_MODULES ; do
                echo -n "${module} "
                /sbin/modprobe $module >/dev/null 2>&1
        done
        $PSENSORS -s

        RETVAL=$?
        if [ $RETVAL -eq 0 ] && touch /var/lock/subsys/lm_sensors ; then
                echo_success
                echo
        else
                echo_failure
                echo
        fi
}

stop() {
        check_sensors "Stopping"

        echo -n "Stopping $prog: "

        for module in $HWMON_MODULES $BUS_MODULES ; do
                /sbin/modprobe -r $module >/dev/null 2>&1
        done

        RETVAL=$?
        if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/lm_sensors ; then
                echo_success
                echo
        else
                echo_failure
                echo
        fi
}

dostatus() {
        $PSENSORS
        RETVAL=$?
        if [ $RETVAL -ne 0 ]; then
                RETVAL=3
        fi
}

restart() {
        stop
        start
}

condrestart() {
        [ -e /var/lock/subsys/lm_sensors ] && restart || :
}

# See how we were called.
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  status)
        dostatus
        ;;
  restart|reload)
        restart
        ;;
  condrestart)
        condrestart
        ;;
  *)
        echo "Usage: $0 {start|stop|status|restart|reload|condrestart}"
        exit 3
esac

exit $RETVAL

Do you confirm that? What should I do in order to remove lm-sensor and reinstall it again?
 

// Naderan *Mahmood;



From: Guenter Roeck <guenter.roeck@xxxxxxxxxxxx>
To: Jean Delvare <khali@xxxxxxxxxxxx>
Cc: Mahmood Naderan <nt_mahmood@xxxxxxxxx>; lm-sensors <lm-sensors@xxxxxxxxxxxxxx>
Sent: Wed, September 1, 2010 7:02:25 PM
Subject: Re: lmsensors doesn't detect core-i7 sensors

On Wed, Sep 01, 2010 at 09:56:01AM -0400, Jean Delvare wrote:
> On Wed, 1 Sep 2010 06:26:34 -0700, Guenter Roeck wrote:
> > On Wed, Sep 01, 2010 at 04:16:41AM -0400, Mahmood Naderan wrote:
> > > >sudo /etc/init.d/lm_sensors restart
> > >
> > > mahmood@localhost:~$<mailto:mahmood@localhost:~$> sudo /etc/init.d/lm-sensors restart
> > > .: 39: Can't open /etc/init.d/functions
> > >
> > > Note there is no lm_sensors. I have lm-sensors
> > >
> >
> > I tried /etc/init.d/lm-sensors on a lucid (10.04) system and it works for me. It looks like
> > you overwrote the original version of /etc/init.d/lm-sensors with prog/init.d/lm_sensors.
> > That won't work - prog/init.d/lm_sensors does not work with lucid. You'll need to reinstall
> > the original version of /etc/init.d/lm-sensors and try again.
>
> I proposed once to delete these initialization scripts from our
> repository as they are quite distribution specific, but the few votes
> were not in my favor.
>
How about some kind of warning, or at least use different wording in sensors-detect ?

The current text is quite absolute ("Copy prog/init/lm_sensors.init to /etc/init.d/lm_sensors")
and really invites users to overwrite the distribution specific scripts.

Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux