vmatare / thinkfan

The minimalist fan control program
GNU General Public License v3.0
552 stars 62 forks source link

crash on sensor file read error #134

Closed qbe closed 3 years ago

qbe commented 3 years ago

I recently noticed that on my machine, for some reason, some of the sensor files get removed and / or renamed on reboot and / or update. That in itself would neither be tragic not the fault of thinkfan, but the thinkfan service crashes as soon as it fails to read one of the sensors in its configuration.

I propose a more graceful handling of sensor file read errors, either ignoring (and warning about) unreadable sensors, or possibly a way of specifying alternate names for sensors, or some combination of both.

qbe commented 3 years ago

some ideas about warning behavior on sensor read fails:

qbe commented 3 years ago

edit: just discovered the "yaml config syntax", and the possibilities of if ... lets see if the "name-based hwmon" solves my specific issue for good, but i still think read errors should never crash the thinkfan process

qbe commented 3 years ago

confirmed that read errors can crash the service, even if the sensor section has the "optional" flag set, but only on service startup / restart. If the service is already running, a "Lost" message is added to the log periodically instead.

vmatare commented 3 years ago

This should have been fixed in the master branch for a while now, but it hadn't been released until now: https://github.com/vmatare/thinkfan/releases/tag/1.2.2

qbe commented 3 years ago

Wonderful, its already up-to-date on the AUR

qbe commented 3 years ago

Seems to have fixed the issue.