mbpfan (CLI)
A simple daemon to control fan speed on all MacBook/MacBook Pros (probably all Apple computers) for Linux Kernel 3 and newer
Last updated
Was this helpful?
A simple daemon to control fan speed on all MacBook/MacBook Pros (probably all Apple computers) for Linux Kernel 3 and newer
Last updated
Was this helpful?
This is an enhanced version of
mbpfan is a daemon that uses input from coretemp module and sets the fan speed using the applesmc module. This enhanced version assumes any number of processors and fans (max. 10).
It only uses the temperatures from the processors as input.
It requires coretemp and applesmc kernel modules to be loaded.
It requires root use
It daemonizes or stays in foreground
Verbose mode for both syslog and stdout
Users can configure it using the file /etc/mbpfan.conf
We provide scripts to to load mbpfan daemon at system boot for many distros. Please note that the support is provided by volunteers. mbpfan needs tests and bug reports.
Supported distributions:
Ubuntu
Debian
Archlinux
Fedora
RedHat
CentOS
Gentoo
Alpine
Trisquel
Solus
Be sure to load the kernel modules applesmc and coretemp.
These modules are often automatically loaded when booting up GNU/Linux on a MacBook. If that is not the case, you should make sure to load them at system startup.
How do I know if applesmc and coretemp are loaded?
In most distributions, you can run the following command:
If you see coretemp
and applesmc
listed, you are all set.
If you do not see coretemp
and applesmc
listed, you must load them.
This is usually achieved by inserting the following two lines in the file /etc/modules
Please check the relevant documentation of your GNU/Linux distribution.
On Debian 10 or later install via:
On Fedora 30 or later:
Install the mbpfan
package with:
On Solus, install the package with:
then enable the service.
On Ubuntu 18.04 or later install via:
Compile with
Install with
It copies mbpfan to /usr/sbin, mbpfan.conf to /etc (and overwrites existing files), README.md to /usr/share/doc/mbpfan, and mbpfan.8.gz to /usr/share/man/man8
If you would like to compile with Clang instead of GCC, simply set your system's default compiler to be Clang. Tested with Clang 3.8 and 3.9. Tested with Clang 4.0 along with llvm-lld (The LLVM Linker).
Users may run the tests after building the program. Please run the following command from within the source directory.
Note that this only works on MacBook and not desktop computers due to different environment expectations.
If not installed, run with
If installed, manually run with
If installed and using the init file, run with (Ubuntu example)
Ubuntu
For systemd based init systems (Ubuntu 16.04+), see the systemd section below.
For upstart based init systems (Ubuntu before 16.04), an example upstart job has been provided. For using it, execute:
Debian An init file suitable for /lib/lsb/init-functions (Debian) is located in the main folder of the source files, called mbpfan.init.debian Rename it to mbpfan, give it execution permissions (chmod +x mbpfan) and move it to /etc/init.d Then, add it to the default runlevels with (as root):
Redhat, CentOS, Fedora An init file suitable for /etc/rc.d/init.d/functions (RHEL/CentOS & Fedora) is also located at the same place, this file is called mbpfan.init.redhat. Also rename it to mbpfan, give it execution permissions and move it to /etc/init.d To add the script to the default runlevels, run the following as root:
Gentoo
To automatically run mbpfan at boot, run as root:
systemd As a special bonus, a service file for systemd is also included. To use it, execute the following (as root):
GNU General Public License version 3
This Project Is Based On:
This Project uses following library:
Fix vararg segfaults when daemonized
See .
See . Otherwise, please refer to the Generic Instructions.
Follow the instructions on for installation.
by Per Ola Kristensson.