Luigi 'Comio' Mantellini

Results 24 comments of Luigi 'Comio' Mantellini

@sten0, Can you review the proposed code. Can you attach output of `find /sys/class/power_supply -name online`?. Thanks. luigi

@stem0 @kdave we can backport this script from OpenRC: [on_ac_power](https://github.com/OpenRC/openrc/blob/master/scripts/on_ac_power) and use this implementation if on_ac_power command is not present. This will move all /proc/*blablabla* logic into an external command/function.

this is the code of on_ac_power: [systemd:on_ac_power](https://github.com/systemd/systemd/blob/c5c07649c2fa0f5830058e6f0d84b955c7951cf4/src/basic/util.c#L200 ) it's almost the same.

> - ConditionACPower=yes in the timer units, because maintenance operations will needlessly deplete battery life on laptops, and servers that are on emergency UPS power should probably defer as well...

Hi @sten0 , ConditionACPower=yes will just skip the trigger if you are on battery. I think that is not good for laptops because will be an high probability to skip...

I had this idea: - Don't insert ConditionACPower= in the job and call the script also on battery - The script will check itself the ac power status, waiting (like...

ConditonACPower is just a "skip-only" condition and cannot help. systemd will never add a "ConditionACPower=wait" or similar. To avoid multiple run (but this is another question), I usually create a...

Can we add this helper function to btrfsmaintenance-functions: ``` # function: wait_ac_power # parameter: timeout # # wait until ac power goes online wait_ac_power() { local timecount=0 local timeout=0 [...

See PR #45 Please review the code with your contributions.

Hi All, I checked the sources of systemd-ac-power and they implement a very simple logic. For this reason I backported into PR#45 the OpenRC script that does the same job....