[systemd-devel] Power aware units

Bastien Nocera hadess at hadess.net
Sun Nov 3 06:36:03 PST 2013


Heya,

systemd already allows launching specific tasks based on a timer, and
intervals, and I was wondering whether power awareness was something
planned for launching and stopping units.

MacOS X 10.9 has some additional metadata for units that allows launchd
to stop and start particular tasks based on power levels:
http://arstechnica.com/apple/2013/10/os-x-10-9/16/

We could implement this in 2 ways:
- systemd itself speaks over D-Bus to UPower (using the new
DisplayDevice to merge UPS and batteries) and stop/starts the units.
- systemd ships a set of units that UPower will launch/stop based on
battery status. This would require UPower to know more about some other
subsystems as well such as the lock screen status, or the hard drive
state.

This would be useful for things like backups, housekeeping (emptying old
files from the trash, old thumbnails, etc.), launching update-db, etc.
in addition to the simple timer intervals.

I think the first option is the best one, as in addition to UPower, we'd
need to talk to the kernel/udev (HDD spinning state), and logind (lock
screen status).

In addition to that, would it make sense for distributions to start
porting their cron jobs to use systemd?

Cheers



More information about the systemd-devel mailing list