[lm-sensors] Reverse iteration of config files breaks SET overrides
headch at gmail.com
Wed Mar 14 19:55:47 CET 2012
The function sensors_do_chip_sets calls sensors_do_this_chip_sets. The
latter function iterates configuration blocks using
sensors_for_all_config_chips. For each configuration block, it iterates
all SET statements and applies each one using sensor_set_value.
However, sensors_for_all_config_chips returns the configuration blocks
backwards, with the expectation that it's being used to find a
particular value and thus the "last" one (either in /etc/sensors.d or
else the last value in /etc/sensors.conf) is the one the caller cares
about. This means that the last SET statement applied to sysfs (i.e.
the only one that matters) is actually the earliest one in
configuration order, that is, the topmost in /etc/sensors.conf. This
completely breaks the comment at the top of /etc/sensors.conf that all
local tweaks should be placed in /etc/sensors.d, because such tweaks
are ignored if a SET statement for the same variable appears
Thanks for the consideration!
More information about the lm-sensors