[LINUX] [Fan control] Initial setting of fancontorl and error handling


First, type the sensors command



--The system is aware of the module --The system does not recognize the module --When rmp of CPU fan is 0

The following shows each method in the above cases.

Part 1 Recognize module ◯

  1. Set with sudo pwmconfig. The configuration file is saved in / etc / fancontrol.
  2. Enable the service with systemctl enable fancontrol.
  3. Set to restart fancontrol after the return of suspend. Place the configuration file in / lib / systemd / system-sleep / Create a shell under system-sleep of systemd that specifies the behavior when returning from suspend. (The name can be anything.)


case "$1" in
  exec service fancontrol restart

Part 2 Recognize modules ☓

When the CPU fan is 0 rpm

★ I referred to this ★ https://github.com/lm-sensors/lm-sensors/issues/134#issuecomment-513506723

The solution is to change the Linux boot settings. Add ʻacpi_enforce_resources = lax after quiet splash`.


GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_enforce_resources=lax"

Apply settings and restart

sudo update-grub

Confirm again


--Part 1 Recognize the module ◯ Execute the method.

Error handling

hwmon allocation changed and fancontrol cannot be executed

Since this is a Linux specification, there seems to be no fundamental solution, so it seems that the best way is to duplicate the fancontrol service when the hwmon allocation changes.

Example) Set with hwmon2 → Reboot → hwmon2 cannot be found!


  1. Create fancontrol-2.service by duplicating fancontrol.service set in hwmon2
  2. Change the ConditionPathExists of the newly created service.
  3. Add to the suspend setting.

fancontrol.Duplicate service

sudo cp /lib/systemd/system/fancontrol.service /lib/systemd/system/fancontrol-2.service

fancontorl-2.edit service

Description=fan speed regulator
# Run pwmconfig to create this file.
Documentation=man:fancontrol(8) man:pwmconfig(8)

ExecStartPre=/usr/sbin/fancontrol --check


suspend settings

case "$1" in
  exec service fancontrol restart
  exec service fancontrol-2 restart

Recommended Posts

[Fan control] Initial setting of fancontorl and error handling
Error divided by 0 Handling of ZeroDivisionError
pix2 pix tensorflow2 Record of trial and error
Summary of error handling methods when installing TensorFlow (2)