Announcement: Common Power-Management Framework
It is my pleasure to announce the creation of a project to create a
common power-management framework for Debian (and eventually, the
world). This idea, in various forms, has been discussed several times
in the past with a generally positive response. These ideas have
even been implemented, to some extent, in the laptop-mode-tools and
pbbuttonsd packages. Now we finally have enough interest and
coordination to make some real progress in putting together a coherent
solution that can provide a valuable service to Debian.
Fundamentally, our goal is to create an architecture-independent,
power-system-independent, and power-daemon-independent system to handle
power-related events (e.g. lid close, battery events). This will likely
happen by hooks from the power daemons (scripts in their event handlers)
that will invoke a common event handler. This common handler will run
its system-independent scripts (possibly in the style of a runlevel)
based on its configuration, then return control to the daemon to
complete its handling.
Now to the big question... Why? At first glance, this may seem like
just another level of cruft to unnecessarily complicate a system that
currently works just fine. Quite to the contrary, the design goals of
the common power-management framework is to simplify the system and
provide many useful features to developers, administrators, and users.
There should be no need to modify anything in the daemon's event handler
for all but the most daemon-specific contexts. In fact, it has been
suggested (although it is probably a pipe dream at this point) that the
common event handler could completely replace the script interface of
the existing power daemons.
Some of the benefits of this system: Developers will be able to respond
to power-related events, regardless of architecture, daemon, and OS by
installing a single script for the common event handler. This script
will be properly handled even as new power-systems and daemons are
created with no necessary changes from the developer. Administrators
will be able to easily share configurations between computers with
different power systems and operating systems, and easily upgrade from
one power system to another. Users will be able to choose from several
standard actions for power events during install and to easily
change/customize these actions.
We have not yet finalized any of the design decisions, and invite anyone
interested in the specifics to join the conversation on the
powermgmt-devel mailing list.
On behalf of the Common Power-Management Framework team,
5. It has also been suggested to provide DBUS messages on power-related
events and status that programs could respond to/query. Also,
inclusion/creation of command line tools for querying power status is
6. This will probably be implemented using a -scripts package that will
install scripts to run based on debconf questions during installation.