Daily Shaarli
January 26, 2024
1. Install the necessary package
$sudo apt install thinkfan lm-sensors
2. Create the configuration file
$sudo nano /etc/thinkfan.conf
add this lines:
sensors:
- tpacpi: /proc/acpi/ibm/thermal
indices: [0]fans:
- tpacpi: /proc/acpi/ibm/fanlevels:
- [0, 0, 55]
- [1, 54, 56]
- [2, 55, 60]
- [3, 59, 62]
- [4, 60, 67]
- [5, 64, 74]
- [6, 70, 83]
- [7, 78, 96]
- [127, 89, 32767]
look at https://wiki.gentoo.org/wiki/Fan_speed_control/thinkfan
! levels : [speed level | start temp | end temp]
3. Enable acpi_fancontrol
$sudo nano /etc/modprobe.d/thinkpad_acpi.conf
add this lines:
options thinkpad_acpi fan_control=1
Activate kernel settings by running this:
$sudo modprobe -r thinkpad_acpi && sudo modprobe thinkpad_acpi
4. Enable the thinkfan.service
4a. runit
$sudo mkdir /etc/sv/thinkfan
$sudo mkdir /etc/sv/thinkfan/log
$sudo nano /etc/sv/thinkfan/run
#!/bin/sh
[ -r ./conf ] && . ./conf
exec thinkfan -n ${OPTS:-} 2>&1
$ sudo chmod +x /etc/sv/thinkfan/run
$sudo nano /etc/sv/thinkfan/conf
# -- mode: sh; --
# Additional command line arguments for thinkfan(1)
OPTS=''# Setting this to 1 enables logging, any other value - disables.
LOGGING_ENABLE=1
# The directory will be created for you, if logging is enabled.
LOG_DIR='/var/log/thinkfan'
$sudo nano /etc/sv/thinkfan/log/run
#!/bin/sh
[ -r ../conf ] && . ../conf
if [ "${LOGGING_ENABLE}x" = "1x" ]; then
# Create the log directory if not exists.
[ -d "${LOG_DIR}" ] || mkdir -p "${LOG_DIR}"exec svlogd -tt "${LOG_DIR}"
else
exec chpst -b thinkfan-log-null cat >/dev/null
fi
$ sudo chmod +x /etc/sv/thinkfan/log/run
$sudo ln -s /etc/sv/thinkfan /etc/runit/runsvdir/default
4b. systemd
In order to start the service any time you boot up your machine, we need to enable it!
$sudo systemctl enable --now thinkfan.service
5. Check if the service is running !
5a. runit
$sudo sv status thinkfan
5b. systemd
$sudo systemctl status thinkfan.service
This never worked for me: https://web.archive.org/web/20220711225154if_/https://askubuntu.com/questions/22108/how-to-control-fan-speed/1139409#1139409