Bug 57014

Summary: /etc/systemd/logind.conf should have HandleExternalPower, HandleBatteryPower if systemd is to replace acpid; or other means to achieve power-friendly "daily tasks" on laptops
Product: systemd Reporter: Shawn Rutledge <shawn.t.rutledge>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: enhancement    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Shawn Rutledge 2012-11-12 13:42:37 UTC
I was looking for a way that systemd could cause crond to start only when my laptop is plugged in to AC power, and stop it when it's on battery power.  There is HandleLidSwitch, HandleSuspendKey etc. already, but handling change in charging status seems to be something acpid provides which systemd does not yet.  Or am I missing something?

Then again, systemd is supposed to replace cron anyhow.  So maybe what is needed instead is a way to run a task when the system is idle AND it's on AC power (and maybe within a certain time range).  That would be for tasks that have traditionally been done by /etc/cron.daily jobs, such as updatedb.
Comment 1 Pavel Procopiuc 2013-01-10 14:43:25 UTC
This can probably now be solved with systemd-197 using new timer functionality together with ConditionACPower
Comment 2 Lennart Poettering 2013-01-15 00:53:12 UTC
Yeah, ConditionACPower should do the job.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.