LinuxCommandLibrary

fancontrol

Control system cooling fans

TLDR

Start fancontrol using default /etc/fancontrol configuration file

$ fancontrol
copy

Start fancontrol using custom configuration file path
$ fancontrol [path/to/config_file]
copy

SYNOPSIS

fancontrol [<options>]

PARAMETERS

--nodaemon
    Run once and exit without daemonizing. Useful for testing or one-shot operations.

--check
    Verify the configuration file for syntax and validity, then exit. Does not control fans.

--verbose
    Provide more detailed output during execution, useful for debugging.

--debug
    Output extensive debugging information, typically used by developers.

--config
    Specify an alternative configuration file path instead of the default (e.g., /etc/fancontrol).

DESCRIPTION

fancontrol is a daemon that reads temperature data from hardware monitoring chips (via lm-sensors) and adjusts the speed of system fans by controlling their Pulse Width Modulation (PWM) outputs. It's designed to keep your system cool while minimizing fan noise.

It operates by periodically checking configured temperature sensors and comparing them against user-defined limits (e.g., MINTEMP, MAXTEMP). It dynamically adjusts the fan's PWM value accordingly, increasing speed as temperatures rise and decreasing it when temperatures fall. Proper configuration, often facilitated by pwmconfig, is crucial. It requires a correctly set up lm-sensors installation and root privileges to function effectively.

CAVEATS

  • Requires the lm-sensors package to be installed and a successful run of sensors-detect to identify hardware monitoring chips.
  • Needs appropriate kernel modules loaded for specific hardware monitoring chips (e.g., nct6775, it87).
  • Requires root privileges to operate, as it directly manipulates hardware registers.
  • Configuration can be complex and highly depends on specific motherboard and fan capabilities; pwmconfig is highly recommended for initial setup.
  • Incorrect configuration can lead to system overheating or excessive fan noise.
  • Not all motherboards or fan headers support PWM control.

CONFIGURATION FILE

fancontrol primarily relies on its configuration file, typically located at /etc/fancontrol or /etc/lm-sensors/fancontrol. This file defines which temperature sensors control which PWM outputs, along with crucial parameters such as minimum and maximum temperatures (MINTEMP, MAXTEMP), fan speed ranges (MINPWM, MAXPWM), and the update interval (INTERVAL). It is strongly recommended to generate this file using the pwmconfig utility, which interactively tests fan control capabilities and helps set up the initial configuration based on detected hardware.

DAEMON OPERATION

fancontrol is designed to run as a background daemon, ensuring continuous fan speed management. It is usually started automatically at boot via a systemd service (e.g., fancontrol.service) or a traditional init.d script, depending on the Linux distribution's initialization system. Once running, it periodically monitors temperatures and adjusts fan speeds based on the rules defined in its configuration file, providing dynamic thermal management without user intervention.

HISTORY

fancontrol is a core component of the lm-sensors project, which began in the late 1990s to provide Linux users with robust hardware monitoring capabilities. Its development has been driven by the increasing need to manage system temperatures and fan acoustics dynamically. It evolved alongside kernel support for various hardware monitoring chips, becoming an essential utility for server and desktop users aiming for optimal system cooling and noise reduction. Its reliance on a configuration file, often generated by the interactive pwmconfig utility, has been a consistent aspect of its design, simplifying the initial setup process for most users.

SEE ALSO

sensors(1), pwmconfig(8), sensors-detect(8), lm_sensors(4), systemd(1)

Copied to clipboard