Bug 827928

Summary: /sbin/fancontrol: line 465: [: too many arguments
Product: [Fedora] Fedora Reporter: Erik Logtenberg <erik>
Component: lm_sensorsAssignee: Jaromír Cápík <jcapik>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: aghoras, dhoward, hdegoede, jcapik, ovasik, rvokal
Target Milestone: ---Keywords: Reopened
Target Release: ---Flags: jcapik: needinfo?
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lm_sensors-3.3.5-6.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-18 01:58:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Erik Logtenberg 2012-06-03 20:39:43 UTC
Description of problem:

Fancontrol gives me the following error over and over:

/sbin/fancontrol: line 465: [: too many arguments

Version-Release number of selected component (if applicable):
$ rpm -qf /sbin/fancontrol 
lm_sensors-3.3.2-2.fc17.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Start fancontrol
2. Observe given errors
  
Actual results:

Fancontrol seems to work okay even though it gives these errors. It doesn't crash and it still appears to manage the fanspeed.

Expected results:

Silent operation.

Additional info:

I checked line 465 and it's this:

463 # calculate the new value from temperature and settings
464 pwmval="(${tval}-${mint})*(${maxpwm}-${minso})/(${maxt}-${mint})+${minso}"
465 if [ $pwmpval -eq 0 -o $min_fanval -eq 0 ]

I noticed $pwmval contains an integer, varying roughly between 50 and 250 in my case. The $min_fanval variable though, is empty. I suspect that's not meant to be and is the cause of this error.
Why this variable is empty, I don't know.

Comment 1 Erik Logtenberg 2012-10-21 18:20:33 UTC
So... is any more information required? Is this the right place for this bug report?

Comment 2 Jaromír Cápík 2012-10-22 16:25:05 UTC
Hello Erik.

I became the new package owner/maintainer few weeks ago and I'll try to look at the issue asap.

Regards,
Jaromir.

Comment 3 Jaromír Cápík 2012-10-22 16:49:55 UTC
Could you please attach your /etc/fancontrol configuration file?

Thanks.

BR, J.

Comment 4 Erik Logtenberg 2012-10-23 12:52:04 UTC
Sure, no problem. This file was auto-generated by the way, I didn't edit it.

$ cat /etc/fancontrol
# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=10
DEVPATH=hwmon0=devices/platform/coretemp.0 hwmon1=devices/platform/f71882fg.656
DEVNAME=hwmon0=coretemp hwmon1=f71889a
FCTEMPS=hwmon1/device/pwm1=hwmon0/device/temp1_input
FCFANS= hwmon1/device/pwm1=
MINTEMP=hwmon1/device/pwm1=40
MAXTEMP=hwmon1/device/pwm1=60
MINSTART=hwmon1/device/pwm1=150
MINSTOP=hwmon1/device/pwm1=0

Comment 5 Jaromír Cápík 2012-10-23 13:07:16 UTC
Hi Erik.

Yes, that was my second question. I didn't ask in my previous comment, because I wanted to avoid an accidental file overwrite.

Now ... could You please try to regenerate the config and check for differences?

Thanks,
J.

Comment 6 Erik Logtenberg 2012-10-23 13:15:28 UTC
Okay, I stopped fancontrol, ran pwmconfig, saved the new config file and restarted fancontrol again.

I see no difference in the generated config file:

$ cat /etc/fancontrol 
# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=10
DEVPATH=hwmon0=devices/platform/coretemp.0 hwmon1=devices/platform/f71882fg.656
DEVNAME=hwmon0=coretemp hwmon1=f71889a
FCTEMPS=hwmon1/device/pwm1=hwmon0/device/temp1_input
FCFANS=hwmon1/device/pwm1=
MINTEMP=hwmon1/device/pwm1=40
MAXTEMP=hwmon1/device/pwm1=60
MINSTART=hwmon1/device/pwm1=150
MINSTOP=hwmon1/device/pwm1=0

Well, at least it's consistent ;)

Would you like me to paste the console output of pwmconfig too? It's kind of lengthy...

Comment 7 Erik Logtenberg 2012-10-23 13:16:39 UTC
But just to be sure, pwmconfig did rewrite the config file, I checked the timestamp:

-rw-r--r--. 1 root root 398 Oct 23 15:13 /etc/fancontrol

Comment 8 Fedora End Of Life 2013-07-03 22:53:02 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 9 Erik Logtenberg 2013-07-04 11:10:57 UTC
This bug is still open. It hasn't been fixed, and I'm still seeing this.

Comment 10 Fedora End Of Life 2013-12-21 08:37:52 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 11 Fedora End Of Life 2014-02-05 11:59:39 UTC
Fedora 18 changed to end-of-life (EOL) status on 2014-01-14. Fedora 18 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 12 Jaromír Cápík 2014-03-17 17:25:42 UTC
Hello Erik.

Sorry for no response to your latest comments.
May I ask you to retest that in Fedora 20?

Thank you,
Jaromir.

Comment 13 Erik Logtenberg 2014-08-08 07:53:58 UTC
I'll retest soon. I only run fancontrol on one of my machines and that machine isn't running Fedora 20 yet. As soon as I've upgraded that machine I'll get back with the results.

Comment 14 aghoras 2015-04-12 16:04:26 UTC
near line 437 around:

else
    fanval=1  # set it to a non zero value, so the rest of the script still works
fi

add the line: min_fanval=1 to get:

else
    fanval=1  # set it to a non zero value, so the rest of the script still works
    min_fanval=1
fi

Comment 15 Erik Logtenberg 2015-04-13 11:05:59 UTC
Lol well it took almost 3 years and 4 major releases, but this does fix the bug.

It would be nice if this change could be incorporated in the fancontrol package.

Comment 16 Jaromír Cápík 2015-04-14 11:41:19 UTC
Thanks for the news, guys! Unfortunately I have no HW for testing the fancontrol on and therefore the troubleshooting is not easy. Anyway, the modification looks reasonable. I'm gonna ask my colleagues whether they could lend me their HW for a quick test so that I could feel more comfortable with committing the modification.

Comment 17 Jaromír Cápík 2015-07-14 15:34:55 UTC
I couldn't find a suitable HW, therefore committing as is.

Comment 18 Jaromír Cápík 2015-07-14 15:43:25 UTC
Guys, this has been redesigned in the upstream version 3.4.0. The 3.4.0 version is already in Rawhide. Could you please test the rawhide package and share results?

The RPMs can be obtained here:
http://koji.fedoraproject.org/koji/buildinfo?buildID=665239

Thanks in advance.

Comment 19 Fedora Update System 2015-07-14 16:08:01 UTC
lm_sensors-3.3.5-6.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/lm_sensors-3.3.5-6.fc21

Comment 20 Fedora Update System 2015-07-14 16:09:11 UTC
lm_sensors-3.3.5-6.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/lm_sensors-3.3.5-6.fc22

Comment 21 Jan Kurik 2015-07-15 15:07:46 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23

Comment 22 Fedora Update System 2015-07-16 02:33:05 UTC
Package lm_sensors-3.3.5-6.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing lm_sensors-3.3.5-6.fc22'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-11623/lm_sensors-3.3.5-6.fc22
then log in and leave karma (feedback).

Comment 23 Fedora Update System 2015-07-18 01:58:09 UTC
lm_sensors-3.3.5-6.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 24 Fedora Update System 2015-07-30 13:53:48 UTC
lm_sensors-3.3.5-6.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.