Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am really really confused about the power management tools available for Linux: I have Arch Linux with XFCE on my laptop.

The guides on the the Arch Linux wiki list

  • acpi
  • acpid
  • pm-utils
  • cpufreq
  • laptop-mode-tools

to manage power, suspension, disks and CPU, WiFi, etc.

But I can't understand what the relationships between them are. Apparently they don't require each other (dependencies are listed as optional) but it's not clear to me what this implies: do they work together doing different things or are they alternative to each others or conflict with each other or what?


At the moment I only have pm-utils (+upower) installed. Do I also need acpi and/or acpid? And what about laptop-mode-tools: is this kind of supervisor of all the other tools? If so, should I configure only laptop-mode-tools or also each of the other tools separately? How do they interact with lm-sensors and cpufreq?

In addition to this, there is XFCE Power Manager, which seems to be unrelated to any of the above tools, as it works even if they are not installed. So my question is again, if I install the others will they conflict with XFCE Power Manager? And what about the power management options included in Xscreensaver? Do they conflict or do they override the settings in XFCE Power Manager (or acpi or pm-utils)?

All I want to do really is to have an efficient use of energy:

  • be able to go to standby/suspension
  • don't have the fan running all the time
  • don't overheat/damage the CPU and the hard drive
  • turn off WiFi when in standby/suspension
  • et cetera
share|improve this question

1 Answer 1

up vote 13 down vote accepted
  • acpi is just a small program that displays basic ACPI information.

  • acpid is a daemon that handles ACPI events - mostly power button, lid, battery and related stuff. For example, if the power button was pressed, acpid runs shutdown. When AC power is connected, acpid can run the apropriate laptop-mode-tools command. If you use systemd, then it replaces most of acpid's functionality.

  • cpufreq (now obsolete) is a set of tools for adjusting CPU frequency. The core functionality is part of the kernel and accessible through /sys, and cpufreq commands are just for convenience, but some scripts may require them.

  • cpufreqd (with the d) is an user-space daemon that can be used as a replacement for the default kernel-space governors (powersave, ondemand, performance). It is not necessary – for most uses, the standard governors are enough.

  • cpupower is a replacement for cpufreq – it allows setting CPU frequency settings from command line.

  • laptop-mode-tools does various system adjustments whenever you plug or unplug AC power to your laptop – for example, disk spin-down times or switching cpufreq governors. It is triggered by acpid on AC events, and is inactive the rest of the time.

    (Note: Some of the settings in laptop-mode-tools may actually hurt performance and/or sanity; for example, it disables Ethernet autonegotiation, which IMHO is just silly.)

  • pm-utils handle the preparations of suspending to memory and/or disk (running pre-suspend hooks, choosing the best method). They are inactive the rest of the time.

    You used to need pm-utils to cleanly suspend the machine, but on modern machines, pm-utils does very little as it can just tell the kernel to suspend. If you use systemd, then it replaces pm-utils.

  • Additionally, pm-utils comes with a pm-powersave command that performs most of the same functions as laptop-mode-tools. pm-powersave is triggered by upower when you plug/unplug AC power, and performs various adjustments.

  • systemd-logind has functions for suspending/hibernating, and handles the most common ACPI events (lid switch, power button, etc.) It replaces acpid and pm-utils on most systems.

    (Unlike pm-utils, however, systemd-logind does not come with any pre-suspend hooks or other workarounds by default, and only uses the default kernel suspend method. It expects driver bugs to be fixed in the drivers.)

  • upower is an abstraction layer for desktop applications to various power parameters. Programs can use it to check battery status, adjust backlight, or suspend the system without having to care about the specific platform. upower also uses PolicyKit to allow various actions (suspend, etc) without giving away full root privileges. It relies on pm-utils and acpid. GNOME and Xfce require upower for their "power management" settings.

  • Xfce Power Manager controls such parameters as display poweroff time, CPU scaling, LCD brightness, ACPI events... (The function are similar to acpid and laptop-mode-tools, which both only have one system-wide configuration, while XfPM allows per-user settings.) XfPM only manages the policy, but relies on upower for the actual mechanisms. Also, XfPM sends out[citation needed] such notifications as "Low battery".

Note: I'm not entirely sure what is the relation between XfPM, acpid, laptop-mode-tools, and upower. It seems to me that XfPM replaces most of acpid/l-m-t functions, but not all of them.

share|improve this answer
    
thanks a lot for your explanation. Let me see if I understand: Xfce Power Manager is a sort of 'GUI' which relies on upower, which needs pm-utils and also acpid (although acpid is not a dependency but this might be an archlinux issue). pm-utils does only suspend and laptop-mode-tools does other adjustments, but they do not conflict because they do different things. However they both need acpid to know what is going on. And finally cpufreq (and cpufreqd) are probably not necessary because the kernel should take care of that. Is this more or less correct? –  rs028 Aug 15 '11 at 18:32
    
@rsom: XfPM is both a GUI for adjusting the settings, and also a daemon that ensures the settings are applied. Other than that, correct. –  grawity Aug 15 '11 at 18:37
    
but it does so by passing orders to the other tools (sort of a higher-level daemon)? Also what about the power management settings in Xscreensaver? do they override those in XfPM or vice versa? –  rs028 Aug 15 '11 at 18:53
    
AFAIK, Xscreensaver does not do any power-management on its own - it simply sets the apropriate parameters in the X11 server. (Try xset q.) It could be that Xfpm simply manages the same settings, or that it doesn't manage the screen at all and lets the screensaver do it. (I'm using GNOME, which has its own program named "GNOME Screensaver", and I don't know whether Xscreensaver is Xfce's default... Reading the source of Xfpm would perhaps give the best answer.) –  grawity Aug 15 '11 at 20:52
    
I think I understand a lot better now. thanks a bunch. –  rs028 Aug 16 '11 at 14:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.