| 1 |
.TH THINKFAN "1" "April 2022" "thinkfan 2.0.0" "thinkfan" |
| 2 |
.SH NAME |
| 3 |
thinkfan \- A simple fan control program |
| 4 |
.SH SYNOPSIS |
| 5 |
.SY thinkfan |
| 6 |
.OP \-hnqDd |
| 7 |
.OP \-b BIAS |
| 8 |
.OP \-c CONFIG |
| 9 |
.OP \-s SECONDS |
| 10 |
.OP \-p \fR[\fIDELAY\fR]\fI |
| 11 |
.YS |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
.SH DESCRIPTION |
| 16 |
|
| 17 |
Thinkfan reads temperatures from a configured set of sensors and then sets fan |
| 18 |
speeds according to temperature limits set in the config file. |
| 19 |
|
| 20 |
.HP |
| 21 |
\fBWARNING\fR: Thinkfan does only very basic sanity checking on the |
| 22 |
configuration. This means that a bad configuration can increase thermal wear |
| 23 |
on the hardware or even cause destruction from overheating! |
| 24 |
|
| 25 |
|
| 26 |
.SS Supported sensors |
| 27 |
|
| 28 |
.TP |
| 29 |
\(bu /proc/acpi/ibm/thermal |
| 30 |
This is provided by the thinkpad_acpi kernel module on older Thinkpads. |
| 31 |
|
| 32 |
.TP |
| 33 |
\(bu temp*_input files in sysfs (hwmon interface) |
| 34 |
May be provided by any hwmon drivers, including thinkpad_acpi on modern |
| 35 |
Thinkpads. |
| 36 |
|
| 37 |
.TP |
| 38 |
\(bu Hard disks with S.M.A.R.T. support (libatasmart) |
| 39 |
Available if thinkfan was compiled with |
| 40 |
.B \-DUSE_ATASMART=ON. |
| 41 |
Note that modern Linux kernels can also expose S.M.A.R.T. hard disk |
| 42 |
temperatures via the hwmon interface in sysfs (and therefore also via |
| 43 |
lm_sensors), which is generally preferrable because it is more efficient. |
| 44 |
|
| 45 |
.TP |
| 46 |
\(bu From the proprietary nVidia driver |
| 47 |
When the proprietary nVidia driver is used, no hwmon for the card will be |
| 48 |
available. In this situation, thinkfan can use the proprietary NVML API to get |
| 49 |
temperatures. |
| 50 |
|
| 51 |
.TP |
| 52 |
\(bu Via lm_sensors (libsensors interface) |
| 53 |
This is a modern and more reliable alternative to the sysfs hwmon interface |
| 54 |
mentioned above. It's basically a standardized abstraction for sysfs hwmon |
| 55 |
where sensors can always be identified uniquely, even when the load order of |
| 56 |
kernel modules changes. |
| 57 |
|
| 58 |
.SS Supported fans |
| 59 |
Thinkfan can control any number of fans, which can be specified in two ways: |
| 60 |
|
| 61 |
.TP |
| 62 |
\(bu /proc/acpi/ibm/fan |
| 63 |
Provided by the thinkpad_acpi kernel module. Note that the kernel module needs |
| 64 |
to be loaded with the option "fan_control=1" to enable userspace fan control. |
| 65 |
On some models, "experimental=1" may also be required. See the |
| 66 |
.B SEE ALSO |
| 67 |
section at the bottom of this manpage for a link to the official thinkpad_acpi |
| 68 |
documentation. |
| 69 |
|
| 70 |
.TP |
| 71 |
\(bu pwm*_enable and pwm? files in sysfs |
| 72 |
Provided by all modern hardware monitoring drivers, including thinkpad_acpi. |
| 73 |
|
| 74 |
|
| 75 |
.SS Mapping temperatures to fan speeds |
| 76 |
|
| 77 |
There are two general modes of operation: |
| 78 |
|
| 79 |
.TP |
| 80 |
\(bu Detailed mode |
| 81 |
In detailed mode, temperature limits are defined for each sensor thinkfan knows |
| 82 |
about. Setting suitable limits for each sensor in your system will probably |
| 83 |
require a bit of experimentation and good knowledge about your hardware, but |
| 84 |
it's the safest way of keeping each component within its specified temperature |
| 85 |
range. See the example configs to learn about the syntax. |
| 86 |
|
| 87 |
.TP |
| 88 |
\(bu Simple mode |
| 89 |
In simple mode, thinkfan uses only the highest temperature found in the |
| 90 |
system. That may be dangerous, e.g. for hard disks. |
| 91 |
That's why you should provide a correction value (i.e. add 10\-15 \[char176]C) |
| 92 |
for the sensor that has the temperature of your hard disk (or battery...). |
| 93 |
See the example config files for details about that. |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
.SH CONFIGURATION |
| 99 |
All of the features described above are configured in the thinkfan config |
| 100 |
file. Its default location is |
| 101 |
.B /etc/thinkfan.conf |
| 102 |
or |
| 103 |
.BR /etc/thinkfan.yaml |
| 104 |
(see also the |
| 105 |
.B -c |
| 106 |
option below). |
| 107 |
An example configuration is provided with the source package. It is intended |
| 108 |
purely for illustration of various scenarios and is not suitable as a basis |
| 109 |
for actually functional config. For a complete reference see the config man |
| 110 |
page |
| 111 |
.BR thinkfan.conf (5). |
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
.SH OPTIONS |
| 116 |
|
| 117 |
.TP |
| 118 |
.B \-h |
| 119 |
Show a short help message |
| 120 |
|
| 121 |
.TP |
| 122 |
.BI \-s " SECONDS" |
| 123 |
Maximum seconds between temperature updates (default: 5) |
| 124 |
|
| 125 |
.TP |
| 126 |
.BI \-b " BIAS" |
| 127 |
Floating point number (\-10 to 30) to smooth out or amplify quick temperature |
| 128 |
changes. |
| 129 |
If a sensor's temperature increases by more than 2 \[char176]C during one |
| 130 |
cycle, we calculate an offset value as follows: |
| 131 |
|
| 132 |
\fBoffset\fR = \fBdelta_t\fR * \fIBIAS\fR / 10 |
| 133 |
|
| 134 |
This offset is then added to the actual temperature: |
| 135 |
|
| 136 |
\fBbiased_t\fR = \fBcurrent_t\fR + \fBoffset\fR |
| 137 |
|
| 138 |
If \fBdelta_t\fR stays below 2 \[char176]C in subsequent loops, \fBoffset\fR |
| 139 |
will be reduced back to 0 in increments of sgn(\fIBIAS\fR) * (1 + |
| 140 |
abs(\fIBIAS\fR/5)). |
| 141 |
|
| 142 |
This means that a negative \fIBIAS\fR will even out short and sudden |
| 143 |
temperature spikes like those seen on some on\-DIE sensors, while positive |
| 144 |
values will exaggerate increasing temperatures to compensate e.g. for sensors |
| 145 |
that respond slowly because they are attached to heavy heatsinks. |
| 146 |
|
| 147 |
Use DANGEROUS mode |
| 148 |
to remove the \-10 to +30 limit. Note that you can't have a space between \-b |
| 149 |
and a negative argument, because otherwise getopt will interpret things like |
| 150 |
\-10 as an option and fail (i.e. write |
| 151 |
.B \-b\-10 |
| 152 |
instead of |
| 153 |
.BR "\-b \-10" ). |
| 154 |
|
| 155 |
The default is 0. |
| 156 |
|
| 157 |
.TP |
| 158 |
.BI \-c " FILE" |
| 159 |
Load a different configuration file. |
| 160 |
By default, thinkfan first tries to load /etc/thinkfan.yaml, and |
| 161 |
/etc/thinkfan.conf after that. |
| 162 |
The former must be in YAML format, while the latter can be either YAML or the |
| 163 |
old legacy syntax. |
| 164 |
|
| 165 |
If this option is specified, thinkfan attempts to load the config only from |
| 166 |
.IR FILE . |
| 167 |
If its name ends in \*(lq.yaml\*(rq, it must be in YAML format. |
| 168 |
Otherwise, it can be either YAML or legacy syntax. |
| 169 |
See |
| 170 |
.BR thinkfan.conf (5) |
| 171 |
and |
| 172 |
.BR thinkfan.conf.legacy (5) |
| 173 |
for details. |
| 174 |
|
| 175 |
.TP |
| 176 |
.B \-n |
| 177 |
Do not become a daemon and log to terminal instead of syslog |
| 178 |
|
| 179 |
.TP |
| 180 |
.B \-q |
| 181 |
Be quiet, i.e. reduce logging level from the default. Can be specified |
| 182 |
multiple times until only errors are displayed/logged. |
| 183 |
|
| 184 |
.TP |
| 185 |
.B \-v |
| 186 |
Be more verbose. Can be specified multiple times until every message is |
| 187 |
displayed/logged. |
| 188 |
|
| 189 |
.TP |
| 190 |
.BR "\-p " [\fISECONDS\fR] |
| 191 |
Use the pulsing\-fan workaround (for older Thinkpads). Takes an optional |
| 192 |
floating\-point argument (0\-10s) as depulsing duration. Default 0.5s. |
| 193 |
|
| 194 |
.TP |
| 195 |
.B \-d |
| 196 |
Do not read temperature from sleeping disks. Instead, 0 \[char176]C is used as that |
| 197 |
disk's temperature. This is needed if reading the temperature causes your |
| 198 |
disk to wake up unnecessarily. |
| 199 |
NOTE: This option is only available if thinkfan was built with \-D USE_ATASMART. |
| 200 |
|
| 201 |
.TP |
| 202 |
.B \-D |
| 203 |
DANGEROUS mode: Disable all sanity checks. May damage your hardware!! |
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
.SH SIGNALS |
| 208 |
SIGINT and SIGTERM simply interrupt operation and should cause thinkfan to |
| 209 |
terminate cleanly. |
| 210 |
.P |
| 211 |
SIGHUP makes thinkfan reload its config. If there's any problem with the new |
| 212 |
config, we keep the old one. |
| 213 |
.P |
| 214 |
SIGUSR1 causes thinkfan to dump all currently known temperatures either to |
| 215 |
syslog, or to the console (if running with the \-n option). |
| 216 |
.P |
| 217 |
SIGPWR tells thinkfan that the system is about to go to sleep. Thinkfan will |
| 218 |
then allow sensor read errors for the next 4 loops because many sensors will |
| 219 |
take a few seconds before they are available again after waking up from a |
| 220 |
sleep state (suspend or hibernate). If the shipped systemd service file |
| 221 |
.B thinkfan-sleep.service |
| 222 |
is installed, it should take care of sending this singal when going to sleep. |
| 223 |
On non-systemd distributions, other mechanisms may have to be used. |
| 224 |
.P |
| 225 |
SIGUSR2 tells thinkfan to re-initialize fan control. This is required by most |
| 226 |
fan drivers after waking up from suspend because they tend to reset fan |
| 227 |
control to automatic mode on wakeup. Similar to SIGPWR, the systemd service |
| 228 |
file |
| 229 |
.B thinkfan-wakeup.service |
| 230 |
should take care of sending this signal on wakeup on systemd systems. On |
| 231 |
non-systemd distributions, other mechanisms may have to be used. |
| 232 |
|
| 233 |
|
| 234 |
.SH RETURN VALUE |
| 235 |
|
| 236 |
.TP |
| 237 |
.B 0 |
| 238 |
Normal exit |
| 239 |
|
| 240 |
.TP |
| 241 |
.B 1 |
| 242 |
Runtime error |
| 243 |
|
| 244 |
.TP |
| 245 |
.B 2 |
| 246 |
Unexpected runtime error |
| 247 |
|
| 248 |
.TP |
| 249 |
.B 3 |
| 250 |
Invalid commandline option |
| 251 |
|
| 252 |
|
| 253 |
|
| 254 |
.SH SEE ALSO |
| 255 |
.nf |
| 256 |
The thinkfan config manpage: |
| 257 |
.BR thinkfan.conf (5) |
| 258 |
|
| 259 |
Example configs shipped with the source distribution, also available at: |
| 260 |
.hy 0 |
| 261 |
https://github.com/vmatare/thinkfan/tree/master/examples |
| 262 |
|
| 263 |
The Linux hwmon user interface documentation: |
| 264 |
https://www.kernel.org/doc/html/latest/hwmon/sysfs\-interface.html |
| 265 |
|
| 266 |
The thinkpad_acpi interface documentation: |
| 267 |
https://www.kernel.org/doc/html/latest/admin\-guide/laptops/thinkpad\-acpi.html |
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
.SH BUGS |
| 272 |
If thinkfan tells you to, or if you feel like it, report issues at the Github |
| 273 |
issue tracker: |
| 274 |
|
| 275 |
.hy 0 |
| 276 |
https://github.com/vmatare/thinkfan/issues |
| 277 |
|