FCNewInit and power management

Callum Lerwick seg at haxxed.com
Sun Oct 16 07:45:00 UTC 2005


I've been tweaking Fedora on laptops for a while now, and there really
is a huge need for a clean, sane, flexible userspace power management
infrastructure in Linux.

Everything is a scattered mess of duplicated effort and functionality.
Looking at it all, I've come to the realization that init/initscripts
really needs to be handling a lot of it! So I look around and discover
its been decided the whole SysvInit/initscripts system needs to be
rewritten anyway. Perfect! However looking at the wiki summary,
( http://fedoraproject.org/wiki/FCNewInit ) it doesn't seem as if anyone
else has realized the role init should have in power management.

Look at apmd's /etc/sysconfig/apm-scripts/apmscript, look at
acpid's /etc/acpi/actions/, look at suspend2's hibernate scripts
( http://www.suspend2.net/downloads/ ). Look at how init already (sorta)
handles UPS power failures! Is a desktop on a UPS really that much
different from a laptop with a battery? These are all extravagant
duplications of what run levels should be doing. (Except maybe acpid
which seems to do mostly nothing by default...)

Run levels are states the system can be in. In addition to the existing
"halt" "reboot" "single user" "no network" and "normal" states, there is
"on battery" and "suspended" states just begging to be added. (I'm not
sure the best way to handle slightly different types of similar states.
We could possibly have a "battery low" state and we have "standby"
"suspend to ram" and "suspend to disk" to choose from. Do they full run
levels of their own? I'm guessing not...)

The system I envision goes something like this. apmd and acpid get
stripped down so all they do is send events to init. init absorbs
similar functionality to acpid, it takes in "events" (over dbus?) from
apmd, acpid, UPS daemons, /usr/bin/poweroff, etc and evaluates rules
(Run scripts like acpid does?) that decide what states to switch to
based on these events. Switching states is then handled much like the
existing SysV init always has, or however the future system decides to
do so.

I'm actually not so sure about where the decision making needs to be,
but the main point is the state switching/tracking should all be done by
init, because thats what its for. Currently, there's a lot of
duplication in the handling of state changes, in apmd, acpid, hibernate,
laptop-mode, etc, that really needs to be centralized.

Comments?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-devel-list/attachments/20051016/0dea3e86/attachment.sig>


More information about the fedora-devel-list mailing list