fanxdell - a versatile, effective, and easy to use fan control program for some Dell / Linux systems.
Info update, 14th November 2018:
Patch for MUSL, look at the end of this page. You can't fopen stdin in MUSL. (Courtesy of a contributor, many thanks!)
64 bit: Testing on a Dell Precision M4400, 64 bit fanxdell and infodell do compile and work - but not properly on this model, as the BIOS constantly switches the fan to the setting it desires. The standard BIOS settings are fairly usable, although I have it sat on a laptop cooler now as well, it still works so far. It should work on earlier era 64 bit D series Latitudes and related models. The binaries including the installer are built on 32 bit GLIBC, recompile (and using the installer is optional) if needed.
Security notice - it shouldn't matter as the kernel will detect this and take care of it internally, but these precompiled binaries are not built with retpoline for Spectre. You should compile your own fanxdell and infodell binaries for permanent use for optimum performance.
Installation - 2 distros requiring extra config:
Calculate Linux - first change init/openrc/fanxdell in the fanxdell-3 source package from :
#!/usr/bin/openrc-run to : /#!/sbin/openrc-run
Then run # ./install_fanxdell (and choose the openrc option.)
Uplos Linux - install_fanxdell (sysvinit) doesn't work here. Install fanxdell and infodell to /usr/local/bin.
Start fanxdell at boot by adding the command (e.g. fanxdell -a) to /etc/rc.d/rc.local
The init script format and management tools differ from Debian style sysvinit. Or you could use the Uplos init script (nearly) at the bottom of this page. Put it in /etc/rc.d/init.d and make it executable. Run :
# chkconfig --add fanxdell
Hopefully that will work then!
----------------------------------------------------------------------------------
Download size 71.8kB
md5 checksum:
$ md5sum fanxdell-3.tar.gz
3a64700470ae0a18163505aab27ab29f fanxdell-3.tar.gz
Extract with:
$ tar -xvzf fanxdell-3.tar.gz
New version for 2016 : fanxdell-3.
Fan control utility for most Dell laptops from the late 90's to 2007 and perhaps beyond.
Runs the fan(s) as an installed daemon, and fanxdell can also be used easily during the installation procedure for a new linux OS. Entirely self contained and needs no other software or kernel modules to work on a linux system, and it's written in C for efficient operation.
Automated installation as daemon can be achieved using install_fanxdell for various inits: sysvinit sysvrc, sysvinit openrc, systemd, runit.
Tested in Debian - systemd and sysvinit, Arch Linux - systemd and openrc, and Void Linux - runit.
New option added in fanxdell to read user argument file and run in the foreground or background.
fanxdell and infodell are otherwise mostly the same as fanxdell-2, most of the changes are to install_fanxdell so it supports more environments.
The control mechanism in fanxdell is based on the original i8kutils (by Massimo Dal Zotto and others) it should work with the same models. Improved support for later Dell's is apparently being added in the current i8kutils developed in conjunction with Ubuntu and Debian by Vitor Augusto (vitorafsr).
i8k info:
https://packages.qa.debian.org/i/i8kutils.html
https://launchpad.net/i8kutils
http://www.diefer.de/i8kfan/index.html - Windows version, this webpage lists original supported models (may not be up to date, and BIOS upgrades can fix early models which otherwise don't work, e.g. CPx H450GT)
The official Dell support forums archive many of the early development discussions of fan control between the original authors and contain a lot of useful information, some of which enabled the extra features used by fanxdell.
Patch for MUSL, look at the end of this page. You can't fopen stdin in MUSL. (Courtesy of a contributor, many thanks!)
64 bit: Testing on a Dell Precision M4400, 64 bit fanxdell and infodell do compile and work - but not properly on this model, as the BIOS constantly switches the fan to the setting it desires. The standard BIOS settings are fairly usable, although I have it sat on a laptop cooler now as well, it still works so far. It should work on earlier era 64 bit D series Latitudes and related models. The binaries including the installer are built on 32 bit GLIBC, recompile (and using the installer is optional) if needed.
Security notice - it shouldn't matter as the kernel will detect this and take care of it internally, but these precompiled binaries are not built with retpoline for Spectre. You should compile your own fanxdell and infodell binaries for permanent use for optimum performance.
Installation - 2 distros requiring extra config:
Calculate Linux - first change init/openrc/fanxdell in the fanxdell-3 source package from :
#!/usr/bin/openrc-run to : /#!/sbin/openrc-run
Then run # ./install_fanxdell (and choose the openrc option.)
Uplos Linux - install_fanxdell (sysvinit) doesn't work here. Install fanxdell and infodell to /usr/local/bin.
Start fanxdell at boot by adding the command (e.g. fanxdell -a) to /etc/rc.d/rc.local
The init script format and management tools differ from Debian style sysvinit. Or you could use the Uplos init script (nearly) at the bottom of this page. Put it in /etc/rc.d/init.d and make it executable. Run :
# chkconfig --add fanxdell
Hopefully that will work then!
----------------------------------------------------------------------------------
Download size 71.8kB
md5 checksum:
$ md5sum fanxdell-3.tar.gz
3a64700470ae0a18163505aab27ab29f fanxdell-3.tar.gz
Extract with:
$ tar -xvzf fanxdell-3.tar.gz
New version for 2016 : fanxdell-3.
Fan control utility for most Dell laptops from the late 90's to 2007 and perhaps beyond.
Runs the fan(s) as an installed daemon, and fanxdell can also be used easily during the installation procedure for a new linux OS. Entirely self contained and needs no other software or kernel modules to work on a linux system, and it's written in C for efficient operation.
Automated installation as daemon can be achieved using install_fanxdell for various inits: sysvinit sysvrc, sysvinit openrc, systemd, runit.
Tested in Debian - systemd and sysvinit, Arch Linux - systemd and openrc, and Void Linux - runit.
New option added in fanxdell to read user argument file and run in the foreground or background.
fanxdell and infodell are otherwise mostly the same as fanxdell-2, most of the changes are to install_fanxdell so it supports more environments.
The control mechanism in fanxdell is based on the original i8kutils (by Massimo Dal Zotto and others) it should work with the same models. Improved support for later Dell's is apparently being added in the current i8kutils developed in conjunction with Ubuntu and Debian by Vitor Augusto (vitorafsr).
i8k info:
https://packages.qa.debian.org/i/i8kutils.html
https://launchpad.net/i8kutils
http://www.diefer.de/i8kfan/index.html - Windows version, this webpage lists original supported models (may not be up to date, and BIOS upgrades can fix early models which otherwise don't work, e.g. CPx H450GT)
The official Dell support forums archive many of the early development discussions of fan control between the original authors and contain a lot of useful information, some of which enabled the extra features used by fanxdell.
Legacy version - fanxdell-1
Download size 32KB
$ md5sum fanxdell-1.tar.gz
9492a24262c400997c0186b9d5fd4553 fanxdell-1.tar.gz
As it doesn't use the 'write ()' function this edition works in the Debian 6 installer while later versions of fanxdell don't. Debian 6 is outdated and no longer supported, and fanxdell-3 works everywhere else I've tested it but I don't use every distro. Some very lighweight old-school distros might find fanxdell-1 helpful during the install procedure if fanxdell-3 didn't work? Minimal C libraries used in installers can lack many common functions. fanxdell-1 has a -i --info option instead of a separate infodell utility, and doesn't write settings data that infodell can read although infodell can still be used in conjunction with it. It's also compatible with later versions in terms of the -k --kill and -a --auto / -d --daemon self replacing abilities and is much the same overall but lacks refinement in handling unlikely situations. It doesn't have an option to run in the foreground, you would need to modify the source code for this. There's no install_fanxdell either. You're much better off using fanxdell-3 as the separate infodell reduces the size of the daemon to comparable levels even with the extra features, and the entire package is improved. This is the original package compiled in 2014 in Debian 7 using an earlier version of GCC, it still works in all the current environments I have available.
I recently tried compiling fanxdell-3 with static libs, but in the Debian 6 CD it still didn't work due to a "kernel too old" error so it seems like this old version would be useful for distros that use the 2.6 kernel if you wanted a precompiled binary.
Download size 32KB
$ md5sum fanxdell-1.tar.gz
9492a24262c400997c0186b9d5fd4553 fanxdell-1.tar.gz
As it doesn't use the 'write ()' function this edition works in the Debian 6 installer while later versions of fanxdell don't. Debian 6 is outdated and no longer supported, and fanxdell-3 works everywhere else I've tested it but I don't use every distro. Some very lighweight old-school distros might find fanxdell-1 helpful during the install procedure if fanxdell-3 didn't work? Minimal C libraries used in installers can lack many common functions. fanxdell-1 has a -i --info option instead of a separate infodell utility, and doesn't write settings data that infodell can read although infodell can still be used in conjunction with it. It's also compatible with later versions in terms of the -k --kill and -a --auto / -d --daemon self replacing abilities and is much the same overall but lacks refinement in handling unlikely situations. It doesn't have an option to run in the foreground, you would need to modify the source code for this. There's no install_fanxdell either. You're much better off using fanxdell-3 as the separate infodell reduces the size of the daemon to comparable levels even with the extra features, and the entire package is improved. This is the original package compiled in 2014 in Debian 7 using an earlier version of GCC, it still works in all the current environments I have available.
I recently tried compiling fanxdell-3 with static libs, but in the Debian 6 CD it still didn't work due to a "kernel too old" error so it seems like this old version would be useful for distros that use the 2.6 kernel if you wanted a precompiled binary.
Uplos init script:
#!/bin/bash
#
# /etc/rc.d/init.d/fanxdell
# fanxdell: fan control daemon
# chkconfig: 2345 03 97
# description: Controls fan
# pidfile: /run/fanxdell_pidfile.pid
# Source function library.
. /etc/init.d/functions
DAEMON="fanxdell"
DPATH="/usr/local/bin"
test -x $DPATH/$DAEMON || exit 0
RETVAL=0
start() {
gprintf "Starting %s : " "$DAEMON"
daemon "$DPATH/$DAEMON --readargs"
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/"$DAEMON"
echo
return $RETVAL
}
stop() {
gprintf "Stopping %s : " "$DAEMON"
killproc "$DPATH"/"$DAEMON"
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/"$DAEMON"
echo
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $DAEMON
;;
restart)
restart
;;
*)
echo "Usage: <servicename> {start|stop|status|restart}"
exit 1
;;
esac
exit $?
#!/bin/bash
#
# /etc/rc.d/init.d/fanxdell
# fanxdell: fan control daemon
# chkconfig: 2345 03 97
# description: Controls fan
# pidfile: /run/fanxdell_pidfile.pid
# Source function library.
. /etc/init.d/functions
DAEMON="fanxdell"
DPATH="/usr/local/bin"
test -x $DPATH/$DAEMON || exit 0
RETVAL=0
start() {
gprintf "Starting %s : " "$DAEMON"
daemon "$DPATH/$DAEMON --readargs"
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/"$DAEMON"
echo
return $RETVAL
}
stop() {
gprintf "Stopping %s : " "$DAEMON"
killproc "$DPATH"/"$DAEMON"
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/"$DAEMON"
echo
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $DAEMON
;;
restart)
restart
;;
*)
echo "Usage: <servicename> {start|stop|status|restart}"
exit 1
;;
esac
exit $?
--- fanxdellorig.c 2018-11-10 20:50:33.198194178 +0000
+++ fanxdell.c 2018-11-10 20:47:51.214975337 +0000
@@ -1031,12 +1031,9 @@
exit (EXIT_FAILURE);
}
/* Redirect std*, pidfile FD will be 3, avoids confusion */
- fclose (stdin);
- fclose (stdout);
- fclose (stderr);
- stdin = fopen ("/dev/null", "r");
- stdout = fopen ("/dev/null", "w");
- stderr = fopen ("/dev/null", "w");
+ freopen( "/dev/null", "r", stdin);
+ freopen( "/dev/null", "w", stdout);
+ freopen( "/dev/null", "w", stderr);
/* The file lock would not survive a fork, so now: */
}
pid_file ();
+++ fanxdell.c 2018-11-10 20:47:51.214975337 +0000
@@ -1031,12 +1031,9 @@
exit (EXIT_FAILURE);
}
/* Redirect std*, pidfile FD will be 3, avoids confusion */
- fclose (stdin);
- fclose (stdout);
- fclose (stderr);
- stdin = fopen ("/dev/null", "r");
- stdout = fopen ("/dev/null", "w");
- stderr = fopen ("/dev/null", "w");
+ freopen( "/dev/null", "r", stdin);
+ freopen( "/dev/null", "w", stdout);
+ freopen( "/dev/null", "w", stderr);
/* The file lock would not survive a fork, so now: */
}
pid_file ();