Ticket #2293 (closed defect: fixed)

Opened 9 months ago

Last modified 9 months ago

fancontrol script errors

Reported by: ticket Assigned to: khali
Priority: major Milestone: 3.0.1
Component: fancontrol Version: 3.0.0
Keywords: Cc: vince@planetvince.info

Description

After creating /etc/fancontrol using v 0.9 of pwmconfig I get following errors.

/sbin/fancontrol: line 98: [: : integer expression expected
/sbin/fancontrol: line 110: [: : integer expression expected
/sbin/fancontrol: line 116: [: : integer expression expected
.
.
.
Error in configuration file (hwmon0/device/pwm1):
MINSTOP must be greater than or equal to MINPWM

see attached file(s) with dialog of the pwmconfig, fancontrol, and the /etc/fanconfig file.

Attachments

lm_sensors_ticket2293 (6.9 kB) - added by ticket on 01/08/08 20:39:15.
output from pwmconfig, followed by output from output from fancontrol, followed by /etc/fancontrol

Change History

01/08/08 20:39:15 changed by ticket

  • attachment lm_sensors_ticket2293 added.

output from pwmconfig, followed by output from output from fancontrol, followed by /etc/fancontrol

01/08/08 20:46:19 changed by ticket

your line numbers 147,148, and 149 show the bash script errors in fancontrol I've been able to get further by editing the file but will quit for now.

vince

01/09/08 12:09:25 changed by khali

  • owner changed from somebody to khali.
  • status changed from new to assigned.
  • milestone set to 3.0.1.

The errors in fancontrol are caused by a broken configuration file. I've made fancontrol a bit more robust to such configuration file errors (r5102), but it's difficult to cleanly catch all mistakes in a shell script.

Why your configuration file was broken, I can't tell. I couldn't reproduce the problem. Maybe there was garbage in your configuration file to start with and it confused pwmconfig. Does the problem still happen if you delete /etc/fancontrol before running pwmconfig?

01/10/08 02:34:53 changed by ticket

I removed /etc/fancontrol, then installed the latest svn copy and used pwmconfig to re-build fancontrol. No more errors.

However. it appears I might have found another bug. if I let pwmconfig take the defaults for the prompts (eg, just hit enter):

Enter the minimum PWM value (0-255)
at which the fan STARTS spinning (press t to test) (150):

Enter the minimum PWM value (0-255)
at which the fan STOPS spinning (press t to test) (100):

then the resultant fancontrol file is:

INTERVAL=10
FCTEMPS=hwmon0/device/pwm1=hwmon0/device/temp2_input
FCFANS= hwmon0/device/pwm1=hwmon0/device/fan1_input
MINTEMP=hwmon0/device/pwm1=45
MAXTEMP=hwmon0/device/pwm1=55
MINSTART=hwmon0/device/pwm1=150
MINSTOP=hwmon0/device/pwm1=100
MISSING 
MINPWM=hwmon0/device/pwm1=100
MAXPWM=hwmon0/device/pwm1=255

01/10/08 09:40:59 changed by khali

This is working as designed. MINPWM and MAXPWM are optional and default to 0 and 255, respectively, if not provided. pwmconfig does not write them to the configuration file if they have the default value. Just run fancontrol and it'll tell:

Settings for hwmon1/device/pwm1:
(...)
  MINPWM=0
  MAXPWM=255

So it is perfectly happy with these default values not being written to /etc/fancontrol.

01/12/08 10:12:14 changed by khali

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