[systemd-devel] ConditionBatteryPower
Lennart Poettering
lennart at poettering.net
Mon Nov 19 17:44:13 PST 2012
On Sat, 17.11.12 11:50, Oleksii Shevchuk (alxchk at gmail.com) wrote:
> Hi list.
>
> I recently browse changes, and found
> http://cgit.freedesktop.org/systemd/systemd/commit/?id=8e6054f732b4bc980d3af3e1386ca94b3a602eb8
>
> I think this not good way to go, as we already have target units. It
> will be better, If we have more standard targets (like
> powersaving.target) + Requisite=, than yet another property in
> unit.
I understand what you are suggesting, but I am not entirely sure I
agree, because power is such a weird thing, that is different from the
rest of the .targets. Here's an attempt why I think that:
- target units such as printer.target or sound.target are something
people want to hook into only for availability, not for
non-availability. That is different for AC where some things should
run when AC is around, and others when it isn't.
- the current target units are currently mostly of the type where
loading things matters, but unloading them is not really that
important. This is different where AC is a state that people care
about in both cases.
- AC might actually be more than a binary thing, it can be AC, or
Battery, or some load percentage. We could easily cover that with a
condition but hardly with one or more targets.
Anyway, I am a bit unsure about this, I really need to think more about
this, before we implement this...
> At least, I can get powersaving state even with broken EC, etc
if you have a broken EC, I think a good solution would be to copy the
unit with the ConditionBatteryPower= you don't like to /etc and comment
the condition there? No?
Lennart
--
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel
mailing list