From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mahmood Naderan Date: Wed, 01 Sep 2010 14:58:47 +0000 Subject: Re: [lm-sensors] lmsensors doesn't detect core-i7 sensors Message-Id: <597875.71733.qm@web50003.mail.re2.yahoo.com> MIME-Version: 1 Content-Type: multipart/mixed; boundary="===============8600986647103373856==" List-Id: References: <929339.59525.qm@web50002.mail.re2.yahoo.com> In-Reply-To: <929339.59525.qm@web50002.mail.re2.yahoo.com> To: lm-sensors@vger.kernel.org --===============8600986647103373856== Content-Type: multipart/alternative; boundary="0-1344184909-1283353127=:71733" --0-1344184909-1283353127=:71733 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable >The current text is quite absolute ("Copy prog/init/lm_sensors.init to =0A= >/etc/init.d/lm_sensors")=0A>and really invites users to overwrite the dist= ribution specific scripts.=0A=A0=0AI really did that. See:=0Amahmood@localh= ost:~$cat /etc/init.d/lm-sensors=0A#!/bin/sh=0A#=0A# chkconfig: - 26 74=0A#= description: sensors is used for monitoring motherboard sensor values.=0A#= config: /etc/sysconfig/lm_sensors=0A#=0A#=A0=A0=A0 This program is free so= ftware; you can redistribute it and/or modify=0A#=A0=A0=A0 it under the ter= ms of the GNU General Public License as published by=0A#=A0=A0=A0 the Free = Software Foundation; either version 2 of the License, or=0A#=A0=A0=A0 (at y= our option) any later version.=0A#=0A#=A0=A0=A0 This program is distributed= in the hope that it will be useful,=0A#=A0=A0=A0 but WITHOUT ANY WARRANTY;= without even the implied warranty of=0A#=A0=A0=A0 MERCHANTABILITY or FITNE= SS FOR A PARTICULAR PURPOSE.=A0 See the=0A#=A0=A0=A0 GNU General Public Lic= ense for more details.=0A#=0A#=A0=A0=A0 You should have received a copy of = the GNU General Public License=0A#=A0=A0=A0 along with this program; if not= , write to the Free Software=0A#=A0=A0=A0 Foundation, Inc., 51 Franklin Str= eet, Fifth Floor, Boston,=0A#=A0=A0=A0 MA 02110-1301 USA.=0A# See also the = lm_sensors homepage at:=0A#=A0=A0=A0=A0 http://www.lm-sensors.org=0A# It us= es a config file /etc/sysconfig/lm_sensors that contains the modules=0A# to= be loaded/unloaded. That file is sourced into this one.=0A# The format of = this file is a shell script that simply defines variables:=0A# HWMON_MODULE= S for hardware monitoring driver modules, and optionally=0A# BUS_MODULES fo= r any required bus driver module (for example for I2C or SPI).=0APSENSORS= =3D/usr/local/bin/sensors=0Aif [ ! -x $PSENSORS ]; then=0A=A0=A0=A0=A0=A0= =A0=A0 PSENSORS=3D/usr/bin/sensors=0Afi=0A# Source function library.=0A. /e= tc/init.d/functions=0ARETVAL=3D0=0Aprog=3D"lm_sensors"=0A# This functions c= hecks if sensor support is compiled into the kernel, if=0A# sensors are con= figured, and loads the config file=0Acheck_sensors() {=0A=A0=A0=A0=A0=A0=A0= =A0 CONFIG=3D/etc/sysconfig/lm_sensors=0A=A0=A0=A0=A0=A0=A0=A0 if ! [ -r "$= CONFIG" ] || ! grep '^HWMON_MODULES' $CONFIG >/dev/null =0A2>&1; then=0A=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 echo -n "$1 $prog: not configure= d, run sensors-detect"=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 echo= _warning=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 echo=0A=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 exit 6=0A=A0=A0=A0=A0=A0=A0=A0 fi=0A= =A0=A0=A0=A0=A0=A0=A0 # Load config file=0A=A0=A0=A0=A0=A0=A0=A0 . "$CONFIG= "=0A}=0Astart() {=0A=A0=A0=A0=A0=A0=A0=A0 check_sensors "Starting"=0A=A0=A0= =A0=A0=A0=A0=A0 echo -n "Starting $prog: loading module "=0A=A0=A0=A0=A0=A0= =A0=A0 for module in $BUS_MODULES $HWMON_MODULES ; do=0A=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0 echo -n "${module} "=0A=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 /sbin/modprobe $module >/dev/null 2>&1=0A=A0=A0=A0=A0= =A0=A0=A0 done=0A=A0=A0=A0=A0=A0=A0=A0 $PSENSORS -s=0A=A0=A0=A0=A0=A0=A0=A0= RETVAL=3D$?=0A=A0=A0=A0=A0=A0=A0=A0 if [ $RETVAL -eq 0 ] && touch /var/loc= k/subsys/lm_sensors ; then=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = echo_success=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 echo=0A=A0=A0= =A0=A0=A0=A0=A0 else=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 echo_f= ailure=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 echo=0A=A0=A0=A0=A0= =A0=A0=A0 fi=0A}=0Astop() {=0A=A0=A0=A0=A0=A0=A0=A0 check_sensors "Stopping= "=0A=A0=A0=A0=A0=A0=A0=A0 echo -n "Stopping $prog: "=0A=A0=A0=A0=A0=A0=A0= =A0 for module in $HWMON_MODULES $BUS_MODULES ; do=0A=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 /sbin/modprobe -r $module >/dev/null 2>&1=0A=A0=A0= =A0=A0=A0=A0=A0 done=0A=A0=A0=A0=A0=A0=A0=A0 RETVAL=3D$?=0A=A0=A0=A0=A0=A0= =A0=A0 if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/lm_sensors ; then=0A= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 echo_success=0A=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 echo=0A=A0=A0=A0=A0=A0=A0=A0 else=0A=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 echo_failure=0A=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 echo=0A=A0=A0=A0=A0=A0=A0=A0 fi=0A}=0Adostat= us() {=0A=A0=A0=A0=A0=A0=A0=A0 $PSENSORS=0A=A0=A0=A0=A0=A0=A0=A0 RETVAL=3D$= ?=0A=A0=A0=A0=A0=A0=A0=A0 if [ $RETVAL -ne 0 ]; then=0A=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0 RETVAL=3D3=0A=A0=A0=A0=A0=A0=A0=A0 fi=0A}=0Ares= tart() {=0A=A0=A0=A0=A0=A0=A0=A0 stop=0A=A0=A0=A0=A0=A0=A0=A0 start=0A}=0Ac= ondrestart() {=0A=A0=A0=A0=A0=A0=A0=A0 [ -e /var/lock/subsys/lm_sensors ] &= & restart || :=0A}=0A# See how we were called.=0Acase "$1" in=0A=A0 start)= =0A=A0=A0=A0=A0=A0=A0=A0 start=0A=A0=A0=A0=A0=A0=A0=A0 ;;=0A=A0 stop)=0A=A0= =A0=A0=A0=A0=A0=A0 stop=0A=A0=A0=A0=A0=A0=A0=A0 ;;=0A=A0 status)=0A=A0=A0= =A0=A0=A0=A0=A0 dostatus=0A=A0=A0=A0=A0=A0=A0=A0 ;;=0A=A0 restart|reload)= =0A=A0=A0=A0=A0=A0=A0=A0 restart=0A=A0=A0=A0=A0=A0=A0=A0 ;;=0A=A0 condresta= rt)=0A=A0=A0=A0=A0=A0=A0=A0 condrestart=0A=A0=A0=A0=A0=A0=A0=A0 ;;=0A=A0 *)= =0A=A0=A0=A0=A0=A0=A0=A0 echo "Usage: $0 {start|stop|status|restart|reload|= condrestart}"=0A=A0=A0=A0=A0=A0=A0=A0 exit 3=0Aesac=0Aexit $RETVAL=0A=0ADo = you confirm that? What should I do in order to remove lm-sensor and reinsta= ll =0Ait again?=0A=A0=0A// Naderan *Mahmood;=0A=0A=0A=0A=0A________________= ________________=0AFrom: Guenter Roeck =0ATo: J= ean Delvare =0ACc: Mahmood Naderan ; lm-sensors =0A=0ASent: Wed, September 1, 201= 0 7:02:25 PM=0ASubject: Re: [lm-sensors] lmsensors doesn't detect core-i7 s= ensors=0A=0AOn Wed, Sep 01, 2010 at 09:56:01AM -0400, Jean Delvare wrote:= =0A> On Wed, 1 Sep 2010 06:26:34 -0700, Guenter Roeck wrote:=0A> > On Wed, = Sep 01, 2010 at 04:16:41AM -0400, Mahmood Naderan wrote:=0A> > > >sudo /etc= /init.d/lm_sensors restart=0A> > > =0A> > > mahmood@localhost:~$ sudo =0A>/etc/init.d/lm-sensors restart=0A> > > .: 39: C= an't open /etc/init.d/functions=0A> > > =0A> > > Note there is no lm_sensor= s. I have lm-sensors=0A> > > =0A> > =0A> > I tried /etc/init.d/lm-sensors o= n a lucid (10.04) system and it works for me. =0A>It looks like=0A> > you o= verwrote the original version of /etc/init.d/lm-sensors with =0A>prog/init.= d/lm_sensors.=0A> > That won't work - prog/init.d/lm_sensors does not work = with lucid. You'll =0A>need to reinstall=0A> > the original version of /etc= /init.d/lm-sensors and try again.=0A> =0A> I proposed once to delete these = initialization scripts from our=0A> repository as they are quite distributi= on specific, but the few votes=0A> were not in my favor.=0A> =0AHow about s= ome kind of warning, or at least use different wording in =0Asensors-detect= ?=0A=0AThe current text is quite absolute ("Copy prog/init/lm_sensors.init= to =0A/etc/init.d/lm_sensors")=0Aand really invites users to overwrite the= distribution specific scripts.=0A=0AGuenter=0A=0A=0A=0A --0-1344184909-1283353127=:71733 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable

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

=0A

 

=0A

I really d= id that. See:

=0A

mahmood@l= ocalhost:~$ cat /etc/init.d/lm-sensors
#!/bin/sh
#
# c= hkconfig: - 26 74
# description: sensors is used for monitoring motherbo= ard sensor values.
# config: /etc/sysconfig/lm_sensors
#
# &n= bsp;  This program is free software; you can redistribute it and/or mo= dify
#    it under the terms of the GNU General Public Li= cense 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
#    MERC= HANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General= Public License for more details.
#
#    You should ha= ve received a copy of the GNU General Public License
#   = along with this program; if not, write to the Free Software
# &nbs= p;  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#&nb= sp;   MA 02110-1301 USA.

=0A

# See also the lm_senso= rs homepage at:
#    
http://www.lm-sensors.org

=0A

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

=0A

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

=0A

PSENSORS=3D/usr/local/bin/sensors

=0A

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

=0A

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

=0A

RETVAL=3D0
prog=3D"lm_sensors"

=0A

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

=0A=

        # Load config file
 =        . "$CONFIG"
}

=0A

star= t() {
        check_sensors "Starting= "

=0A

        echo -n "Star= ting $prog: loading module "

=0A

     = ;   for module in $BUS_MODULES $HWMON_MODULES ; do
  = ;            &n= bsp; echo -n "${module} "
       &nbs= p;        /sbin/modprobe $module >/de= v/null 2>&1
        done
&n= bsp;       $PSENSORS -s

=0A

&nbs= p;       RETVAL=3D$?
   &nb= sp;    if [ $RETVAL -eq 0 ] && touch /var/lock/subsy= s/lm_sensors ; then
        &nbs= p;       echo_success
   &n= bsp;            echo=
        else
   &n= bsp;            echo= _failure
          &nb= sp;     echo
      &nb= sp; fi
}

=0A

stop() {
     &nbs= p;  check_sensors "Stopping"

=0A

    =     echo -n "Stopping $prog: "

=0A

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

=0A

 &n= bsp;      RETVAL=3D$?
    &= nbsp;   if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/lm= _sensors ; then
         &n= bsp;      echo_success
    =             echo
=         else
    =             echo_fai= lure
           &= nbsp;    echo
        = fi
}

=0A

dostatus() {
     &nbs= p;  $PSENSORS
        RETVAL=3D$= ?
        if [ $RETVAL -ne 0 ]; then<= BR>            =     RETVAL=3D3
       = fi
}

=0A

restart() {
     &nbs= p;  stop
        start
}

=0A

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

= =0A

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

=0A

exit $RETVAL

=0A

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

=0A
=0A
// Naderan *Mahmood;
=0A

=0A=

=0A
=0A
=0AFrom: Guenter Roeck <guenter.roeck@ericsso= n.com>
To: Jean Delva= re <khali@linux-fr.org>
Cc: Mahmood Naderan <nt_mahmood@yahoo.com>; lm-sensors <lm-s= ensors@lm-sensors.org>
Sent: Wed, September 1, 2010 7:02:25 PM
Subject: Re: [lm-sensors] lmsensors doesn't detect core-i= 7 sensors

On Wed, Sep 01, 2010 at 09:56:01AM -0400, Jean Delv= are wrote:
> On Wed, 1 Sep 2010 06:26:34 -0700, Guenter Roeck wrote:<= BR>> > On Wed, Sep 01, 2010 at 04:16:41AM -0400, Mahmood Naderan wrot= e:
> > > >sudo /etc/init.d/lm_sensors restart
> > &= gt;
> > > mahmood@localhost:~$<mailto:mahmood@localhost:~$&= gt; 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
> > >
> &= gt;
> > 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-senso= rs and try again.
>
> I proposed once to delete these initiali= zation scripts from our
> repository as they are quite distribution s= pecific, but the few votes
> were not in my favor.
>
How ab= out some kind of warning, or at least use different wording in sensors-dete= ct ?

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

=0A=0A --0-1344184909-1283353127=:71733-- --===============8600986647103373856== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors --===============8600986647103373856==--