Skip to contentSkip to conversation

Reverse iteration of config files breaks SET overrides

lm-sensors Christopher Head 1 participant 1 message Mar 14, 2012

lore
Share & tools
lore
#0 lore raw

Hi,
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 in /etc/sensors.conf.

Thanks for the consideration!
Chris

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors