[systemd-devel] [PATCH] run systemd-tmpfiles-clean only when we have AC power

Lennart Poettering lennart at poettering.net
Thu Apr 10 14:18:37 PDT 2014


On Thu, 03.04.14 15:42, Cristian Rodríguez (crrodriguez at opensuse.org) wrote:

> While it is cool to be neat and clean all the time, this
> task can wait if we are on battery.
> ---
>  units/systemd-tmpfiles-clean.service.in | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/units/systemd-tmpfiles-clean.service.in b/units/systemd-tmpfiles-clean.service.in
> index a5b5acb..06bb21f 100644
> --- a/units/systemd-tmpfiles-clean.service.in
> +++ b/units/systemd-tmpfiles-clean.service.in
> @@ -16,6 +16,7 @@ ConditionDirectoryNotEmpty=|/usr/lib/tmpfiles.d
>  ConditionDirectoryNotEmpty=|/usr/local/lib/tmpfiles.d
>  ConditionDirectoryNotEmpty=|/etc/tmpfiles.d
>  ConditionDirectoryNotEmpty=|/run/tmpfiles.d
> +ConditionACPower=true

This has come up before, but I don't think this is the right thing to
do. It might make sense to modulate the timer frequency depending on
power state, but I am pretty sure we shouldn't just stop cleaning up
things if people never plug in their machine while it is unsuspended...

Modulating the timer frequency would mean to track power state for all
connected power sources from PID1. Which might be OK to do, but isn't
trivial.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list