TLP is not running on system startup after upgrading to Ubuntu 21.04

TLP configurations is not applied on system startup after upgrading to Ubuntu 21.04. Reinstalling the package does not help.

Inspecting TLP systemd unit tlp.service confirms the issue.

$ systemctl status tlp.service                  

● tlp.service - TLP system startup/shutdown
     Loaded: loaded (/lib/systemd/system/tlp.service; enabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: https://linrunner.de/tlp

Solution 1:

The new power-profiles-daemon package is the problem (see TLP/issues/564). This package is installed by default in Ubuntu 21.04+ and a couple of other distributions.

Explanation

The new power-profiles-daemon package comes with a systemd unit power-profiles-daemon.service. This unit declare a conflict with tlp.service causing tlp.service to be effectively disabled.

/lib/systemd/system/power-profiles-daemon.service (notice the Conflicts= directive)

[Unit]
Description=Power Profiles daemon
Conflicts=tuned.service tlp.service auto-cpufreq.service
Before=multi-user.target display-manager.target

...

If a unit has a Conflicts= directive on another unit, starting the former will stop the latter and vice versa. And because tlp.service doesn't declare Conflicts= directive on power-profiles-daemon.service. It will always be the one that get disabled regardless of the activation order of the units.

Solution

  • You may either disable power-profiles-daemon.service unit with sudo systemctl disable power-profiles-daemon.service; or
  • Remove power-profiles-daemon package from the system with sudo apt purge power-profiles-daemon.
  • Alternatively, you may override tlp.service configurations with sudo systemctl edit tlp.service and set the the Conflicts= along with Before= directives manually.
[Unit]
Conflicts=power-profiles-daemon.service
Before=power-profiles-daemon.service