Commit Graph
117 Commits
Author SHA1 Message Date
Jean Delvare 62ed6f484b Fix handling of absolute paths in config
Reported by Marc Ferland. Make DEVPATH and DEVNAME mandatory only when
using relative paths. Optionally support DEVNAME check when using
absolute paths.
2013-05-23 14:09:22 +00:00
Jean Delvare 7e2b5c3376 pwm: Declare local variables as such 2013-05-01 11:37:47 +00:00
Jean Delvare e46e4e519f pwmconfig: Properly deal with multiple fan control
When a given PWM output controls more than one fan,
fanactive_min is no longer a space-separated list of numbers, it will
also include items of the form "A+B". The tests in the rest of the
code do not expect that and choke with errors like:

/usr/sbin/pwmconfig: line 926: [: 538+799: integer expression expected
/usr/sbin/pwmconfig: line 952: [: 538+799: integer expression expected

As the only thing we really care about is whether any fan stops
completely when PWM is 0, we can simply record the minimum of the
lowest speed of all affected fans.
2013-05-01 10:31:00 +00:00
Jean Delvare f2b3e95c59 pwmconfig: Drop a stray comment
fancontrol supports multiple controlled fans for quite some time now.
2013-05-01 10:30:22 +00:00
Jean Delvare 58ec80bf54 pwmconfig: Raise the detection threshold to 3/4
Detection threshold of 2/3 of the maximum speed is too low, some fans
will slow down to about that speed so controlled fans may be missed.
Use 3/4 as the threshold to avoid these false negatives.
2013-05-01 10:29:57 +00:00
Jean Delvare 2096d14c18 pwmconfig: Print the initial PWM values
Print the initial PWM values before letting the user change them. This
should be useful to better understand what happens next, and for user
support in general.
2013-05-01 10:29:00 +00:00
Jean Delvare 2c145550b5 fancontrol: Output error messages to stderr
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6001 7894878c-1315-0410-8ee3-d5d059ff63e0
2011-12-04 16:54:05 +00:00
Jean Delvare bd21ec1ee4 fancontrol: Support setup where one PWM output controls several fans
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6000 7894878c-1315-0410-8ee3-d5d059ff63e0
2011-12-04 16:53:10 +00:00
Jean Delvare fffbe666c4 Drop legacy calls to cut. procfs had several values per file, but
sysfs doesn't.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5857 7894878c-1315-0410-8ee3-d5d059ff63e0
2010-08-22 16:17:57 +00:00
Jean Delvare 501499e834 Wait for fans to return to full speed only once per PWM. In the rare
case where a given PWM output controls more than one fan, this makes
the script somewhat faster.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5856 7894878c-1315-0410-8ee3-d5d059ff63e0
2010-08-22 16:09:08 +00:00
Jean Delvare eb40756d74 When looking for pwm/fan correlations, sample all fans before returning
a given PWM output to full speed. The code used to only sample the first
fan before doing so, so correlation with other fans could be missed.
Problem reported by Charles Pillar. This closes ticket #2380.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5855 7894878c-1315-0410-8ee3-d5d059ff63e0
2010-08-22 16:07:22 +00:00
Jean Delvare 8ddd1d2984 Save hwmon device paths and names in configuration file, and check them
before starting any fan control operation.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5770 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-09-16 15:57:53 +00:00
Jean Delvare bff5a8dde0 Clean up the code writing the configuration file.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5767 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-09-13 11:19:57 +00:00
Jean Delvare 5ee7d14714 Minor line wrapping fix.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5766 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-09-08 17:24:25 +00:00
Jean Delvare c76907971e Check that all referenced sysfs files exist before starting. If not,
quilt immediately. Better no fan control than fan control using an
out-of-sync configuration file.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5765 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-09-08 16:52:29 +00:00
Jean Delvare 835eee0a7f Don't assume legacy references to i2c devices, instead explicitly
check for them. This should help spot invalid configuration files.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5764 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-09-08 14:19:22 +00:00
Jean Delvare 6ff7f5e25b Exit immediately if not root.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5749 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-07-03 19:37:22 +00:00
Jean Delvare dee604c8e9 Add support for absolute path to hwmon devices.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5717 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-05-09 11:43:06 +00:00
Jean Delvare 1141a165ee Create pid file only after successful initialization.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5668 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-02-28 19:42:51 +00:00
Jean Delvare 45446011ec Exit if configuration file can't be read.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5667 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-02-28 19:38:22 +00:00
Jean Delvare b0f50d0788 Drop stray references to procfs interface.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5631 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-01-29 08:58:36 +00:00
Jean Delvare ea854deb03 Drop support for kernels 2.4 and earlier.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5630 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-01-29 08:28:17 +00:00
Jean Delvare 334c9446f5 Don't round temperature values.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5629 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-01-29 08:13:47 +00:00
Jean Delvare 5f269d0f10 Don't choke on missing name attribute. Drivers shouldn't do that, but
we can live without the name attribute, so there's no point in failing.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5345 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-09-28 15:22:44 +00:00
Jean Delvare 66130a9630 Update pwmconfig manual page.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5344 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-09-28 08:18:29 +00:00
Jean Delvare f7ccb96a7c Add support for drivers that place the hwmon attributes in the hwmon
class device directory rather than directly in the device directory.
This is what virtual devices have.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5343 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-09-27 15:35:47 +00:00
Jean Delvare 118a102198 Add a script that provides manual control of the vt1211 PWM outputs.
This script puts the vt1211 in automatic PWM mode and fools the chip
into believing that there is a temp change to force the PWM outputs to
specified values. This is necessary since the standard manual mode of
the vt1211 doesn't seem to work.
Patch from Juerg Haeflinger.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5338 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-09-21 15:25:39 +00:00
Jean Delvare 8f9a67f5bd Strip trailing whitespace.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5330 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-09-09 16:18:27 +00:00
Jean Delvare 78e6d49180 Change default for MINTEMP from 0 to 20 degrees C. Computers never run at
below 20 degrees C, so setting MINTEMP to 0 uselessly reduces the control
range.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5329 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-09-09 13:18:48 +00:00
Jean Delvare 012aae9b58 Skip MINSTOP and MINSTART tests if fan can't stop.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5328 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-09-09 13:15:04 +00:00
Jean Delvare 346159764f Determine MINSTOP automatically.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5327 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-09-09 12:14:28 +00:00
Jean Delvare c0645f4011 Detect and report obviously incorrect fan speeds.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5326 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-09-09 09:30:38 +00:00
Jean Delvare 0277bca881 Print the revision and date at start-up.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5325 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-09-09 07:26:51 +00:00
Jean Delvare 7ca1c39b92 Use the same step values for the MINSTOP test as we do for the detailed
correlation. That is, 15 above 31 and 2 below 31. This makes more sense
than using 10 all the time, as changes in low PWM values tend to have a
greater effect on fan speeds than changes in high PWM values.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5324 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-09-08 13:51:22 +00:00
Jean Delvare 5f9008ddf3 Test MINSTOP before MINSTART. We know that MINSTART can't be less than
MINSTOP, so we can use MINSTOP as the initial value for the MINSTART test.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5323 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-09-08 12:21:20 +00:00
Jean Delvare 01e44478ce Only mention gnuplot if X is running.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5322 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-09-08 12:03:17 +00:00
Jean Delvare 38b2843d60 Add a utility function to filter configuration file variables.
Remove unneeded escapes. This makes the code slightly easier to read.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5321 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-09-08 12:01:16 +00:00
Jean Delvare bf094bc123 Coding-style cleanups.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5320 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-09-08 10:37:28 +00:00
Jean Delvare 1bf9b248b0 Fix MINSTOP and MINSTART test functions. PWM must be enabled for the duration
of the test, and disabled again afterwards. Bug reported by Philippe Roubach.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5318 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-09-08 09:49:13 +00:00
Jean Delvare f9dbe31f15 Tell the user about gnuplot if isn't installed.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5317 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-09-01 11:58:30 +00:00
Jean Delvare a5f4b32d17 Don't use named pipes when we don't need them. Named pipes have been reported
to cause trouble on some systems. This closes ticket #2319.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5271 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-06-02 06:21:06 +00:00
Jean Delvare bcabe00237 Arbitrary version bump.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5182 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-04-16 18:35:46 +00:00
Jean Delvare 5db0d2003f Drop obsolete comment.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5181 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-04-16 18:22:12 +00:00
Jean Delvare 17e7247f28 pwmconfig: Don't start if fancontrol is running.
fancontrol: Don't start if already running, delete fancontrol.pid at
exit time.
This closes ticket #2299.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5180 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-04-16 14:29:01 +00:00
Jean Delvare be4ea8ac3e Don't create the configuration file before it's needed.
Don't preserve configuration file customizations.
Fix permissions of the configuration file.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5179 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-04-16 11:18:36 +00:00
Jean Delvare f2e518511d Patch from Aurelien Jarno:
I have just noticed that the FSF address is the old one in all files
except COPYING. Please find a patch below to fix that.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5163 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-03-26 13:37:12 +00:00
Jean Delvare 8f2142b76e Spelling fix.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5112 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-01-27 14:18:24 +00:00
Jean Delvare 04ae8141b8 MINPWM and MAXPWM may be undefined for a given PWM output.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5111 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-01-27 12:36:28 +00:00
Jean Delvare 3914365547 Fix duplicate warning message when configuration file is broken.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5103 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-01-09 11:01:44 +00:00
Jean Delvare 8d00528cd3 Detect improperly formatted FCTEMPS value (#2293).
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5102 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-01-09 10:59:48 +00:00