LWN.net Logo

Power managers

Power managers

Posted Dec 7, 2006 1:18 UTC (Thu) by fergal (subscriber, #602)
Parent article: Ubuntu "Feisty" Herd 1 released

So, the gnome power manager now has some features that the kde one already had. Presumably it's also got some that the kde one doesn't have yet. I wonder what the xfce one can do.

Am I correct to think that all of these apps duplicate power saving code/logic all for the sake of their GUI toolkits? Or is there a powerd in the background that these are just configuration frontends for? Can I save power without being logged in or do I have to fire up a power-hungry desktop to save power on the console?


(Log in to post comments)

Power managers

Posted Dec 7, 2006 1:33 UTC (Thu) by tialaramex (subscriber, #21167) [Link]

I haven't looked at this specific piece, but in general this sort of thing is done using DBUS to send messages between a (probably privileged) system daemon or demand-launched program and the user-friendly, toolkit specific frontend.

That's how the Bluetooth PIN stuff works now, and Network Manager and network service discovery stuff like Avahi, and so it's probably how the power management stuff works these days too. Desktop software decides policy, the system daemons and the kernel implement it.

So the heavy lifting is probably not being duplicated. In fact, most of the really hard work seems to be in the kernel and driver modules anyway. It's much harder to get all those disks, video cards, USB cameras, bluetooth keyboards and so on back how you left them after a few hours without power than to draw an icon of a battery in three different widget toolkits.

Power managers

Posted Dec 7, 2006 9:40 UTC (Thu) by usr (guest, #42092) [Link]

No, unfortunately it works exactly the way you suggest it should not. The
logic is indeed duplicated across the GUI interfaces. The little
crash-prone applet sitting in the system tray is in fact the "daemon"
making the decisions about power management. Power management does not
work when you are not logged in. If more than one user is logged in, who
knows what might happen?

More specifically it works something like this:

Information about system state:
HAL -> DBUS -> Applet

Power management instructions:
Applet -> DBUS -> HAL

There is another power management solution, kpowersave+powersaved, that
originated with SUSE and that works the way you suggest it should. Some
powersave developers were rather offended by the development of the
current power management solution in Ubuntu, specifically Kubuntu. There
are also plenty of comments suggesting to split off a power management
daemon from the GUI.

Ironically, the reason why the architecture is broken today is that the
Ubuntu solution originated as a GNOME hack written by a developer who
didn't know how to write a system daemon. To his credit he acknowledged
that that a separate daemon would have been the right thing, but no-one
stepped forward to write one at the time.

Power managers

Posted Dec 8, 2006 1:19 UTC (Fri) by fergal (subscriber, #602) [Link]

It's kinda bizarre that someone could write a GUI powermanager but couldn't figure out how to write a daemon.

I'd file a bug but "everything about your project is wrong" bugs don't tend to go too well.

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds