Jump to content

Shutting down lm_sensors problem.


Recommended Posts

When I shutdown my computer, there is some errors when lm_sensors shut down. Here is the 'stop' part of the /etc/init.d/lm_sensors script. What is wrong? ... Basically the system complains about '-ge' ..

 

  stop)

       # Stop daemons.

       gprintf "Shutting down sensord: "

       killproc sensord

       echo



       gprintf "Removing sensors modules: "

       test -r "$CONFIG" && . "$CONFIG"



       modules=`grep ^MODULE_ $CONFIG | wc -l`

       i=`expr$Pmodules`

       while [ $i -ge 0 ]; do

               module=`eval echo '$'MODULE_$i`

               /sbin/modprobe -r $module &>/dev/null

               i=`expr $i - 1`

       done

       echo



       rm -f /var/lock/subsys/lm_sensors

      ;;

 

Thx!

 

MOttS

Link to comment
Share on other sites

Provided that I cannot access the full script,

i=`expr$Pmodules`

shouldn't it be

i=`expr $modules`

 

because expr itself is a command, $P isn't anywere, and modules is or should be a numerical variable set just one line above. If the i= assignation fails, later the [ $i -ge 0 ] will complain about -ge and something like "unary operator expected"

Link to comment
Share on other sites

aru.. you are right! I put

i=`expr $modules'

instead of

i=`expr$Pmodules`

and lm_sensors stoped properly. So there is a mistake in /etc/init.d/lm_sensors script. That's funny.. it's like they wrote it without even testing it.

 

Thank you very much !!!!!!!!!!!!

 

MOttS

Link to comment
Share on other sites

Just out of curiousity, with Mandrake 9/9.1 has either of you ran the following ?

 

"#usr/sbin/sensors-detect" command ?

 

This does everything for you and you don't have to edit any scripts manually. I used this for the last two installs vice manually setting up scripts like was given in the TUTs. You may already know this but I just thought I would provide some input.

Link to comment
Share on other sites

Hi Relic2k

 

To configure lm_sensors on my computer, I basically run that script (sensors-detect). This created /etc/sysconfig/lm_sensor and all the others needed scripts for lm_sensor to run. However, /etc/init.d/lm_sensor had the above error making 'service sensors stop' return errors. So you are right, I should have write it.. I have run 'sensors-detect' and modified /etc/init.d/lm_sensor so that lm_sensor works correctly.

 

Regards,

 

MottS

Link to comment
Share on other sites

Hi Relic2k

 

To configure lm_sensors on my computer, I basically run that script (sensors-detect).  This created /etc/sysconfig/lm_sensor and all the others needed scripts for lm_sensor to run.  However, /etc/init.d/lm_sensor had the above error making 'service sensors stop' return errors.  So you are right, I should have write it.. I have run 'sensors-detect' and modified /etc/init.d/lm_sensor so that lm_sensor works correctly.

 

Regards,

 

MottS

 

K

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...