# A N00bs Question on Powermanagment

## mrknowitall

Hi Folks,

I have a little problem in understanding how powermanagment on Linux works. I read a few documents about hal, powerdevil, kde, acpid and so on. But what I realy don't understand is how these components interact.

E.g.: I usually have KDE 4.3 running. In the powermanagment section of systemsettings, you can define, what should happen if you press a certain key or close your laptop's lid. This should work, as long as long as your button event is properly detected.

But if I have the acpid daemon running, and I defined in KDE that on pressing the power button the machine should go to sleep, acpid seems to take over and does a complete shutdown of the machine. Yet if acpid is not running, hal (as long as logging is enabled) starts crying about not being able to connect to acpid.

In order to get things right, I should understand how the above mentioned components interact. These would be some questions:

* does hal need acpid? 

* do you need acpid at all?

* can you disable the acpi use flag?

* if you don't have KDE (or GNOME) running how does power-devil get configured properly

* on my machine, hal doesn't seem to recognize the sleep nor power button (XF86Sleep and XF86Sleep) on my keyboard, only acpid starts doing something

* what use flags do i really need (pmu, pm-utils acpi)?

* how can I make hal do these things?

Please help me to understand this mess...

Thanks!

Alex

----------

## kukibl

In general, I'm not some power management expert, but I use laptops exclusively in last 4 years (with Linux as only OS), so I learned lots of relevant stuff. First thing, it would be good to check Gentoo documentation concerning power management. This page is excellent reading: http://www.gentoo.org/doc/en/power-management-guide.xml.

 *Quote:*   

> * does hal need acpid?

 

Not sure. As far as I know, acpid is power daemon and HAL doesn't depend on it (no matter which USE flag you use for it).

 *Quote:*   

> * do you need acpid at all? 

 

Yes, if you use powerdevil or you want to setup power management manually (check the link).

 *Quote:*   

> * can you disable the acpi use flag?

 

I guess so, but why would you do it?

 *Quote:*   

> * if you don't have KDE (or GNOME) running how does power-devil get configured properly 

 

Powerdevil is KDE's power management utility/service and I don't think it can function at all without KDE components running. If you use GNOME you will probably use it's own power management utility (gnome-power-manager), XFCE has it's own etc. For WMs you will have to setup power management manually using combination of ACPI daemon (acpid), CPU frequency scaling utility/daemon (cpufrequtils, cpufreqd, powernowd...; it's a MUST on laptops, not sure how much is used on desktops), laptop-mode-tools (got quite advanced lately, except hdd spindown it can control brightness, ethernet, wifi etc.; again it's a MUST on laptops) and probably some manually written scripts.

 *Quote:*   

> * on my machine, hal doesn't seem to recognize the sleep nor power button (XF86Sleep and XF86Sleep) on my keyboard, only acpid starts doing something 

 

Which kernel do you use - manually configured or genkernel? You will probably have to load button module.

 *Quote:*   

> * what use flags do i really need (pmu, pm-utils acpi)?

 

I use pm-utils (actually HAL's laptop USE flag) and acpi. Everything works perfectly fine.

 *Quote:*   

> * how can I make hal do these things? 

 

Once again, check the power management link. I'm not sure that you need (or even if there is possibility) to setup HAL directly when it comes to power management.

----------

## mrknowitall

Thank you! I will investigate this in more detail as soon as I have a bit more time on the hand.

----------

## bandreabis

up?

----------

