Many of Dell Optiplex has no way of controlling fan speed in certain distros of Linux. This is a good enough work around. Fancontrol and/or i8kmon isn't a sure way of making sure that the fans aren't dead or at full blast. This is a crude solve.
How-to:
apt install i8kutils lm-sensors acpi
edit /etc/modules
to contain:
coretemp
i8k
dell-smm-hwmon
edit /etc/modprobe.d/i8k.conf
to contain:
options i8k force=1
reboot
Move tempcontrol.sh to /usr/local/bin/
and make sure it's executable (chmod +x)
Move tempcontrol.service to /etc/systemd/system/
systemctl enable tempcontrol.service
systemctl start tempcontrol.service
Check status with systemctl status tempcontrol.service
Check sensors to make sure that fan speed and temperature is showing correctly
OPTIONAL: To also disable Dell's bios fan control use this
Credits: Tom Freudenberg, Ronny Svedman
Keep /etc/modules
as above
Don't use the i8k config but instead add this to /etc/modprobe.d/dell-smm-hwmon
options dell-smm-hwmon ignore_dmi=1
Run sensors-detect
and then pwmconfig
and if you're lucky you have a functioning fancontrol
Reboot