on laptops, updatedb should check whether on battery before running

Bug #27918 reported by Albert Cardona
8
Affects Status Importance Assigned to Milestone
cron (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

- updatedb: when my laptop is on battery, the last thing I want is for its
energy to be spent unwisely. Running the cron job for the updatedb, which
runs for several minutes consuming lots of chip resources, is a very poor
choice. I have no clue as to whether one can make the updatedb process run if
and only if the laptop is not on battery. The pbbuttons daemon should be
queried for such information.

Sam Morris suggested:

These suggestions should be filed as bug reports on
http://bugzilla.ubuntu.com. FYI, you could suggest that
/etc/cron.daily/find and /etc/cron.daily/slocate test the exit status of
/usr/bin/on_ac_power before running updatedb.

Revision history for this message
Dennis Kaarsemaker (dennis) wrote :

Cron should (and afaik does) check this before running.

Revision history for this message
Albert Cardona (cardona) wrote :

Well, then, why does updatedb run when the laptop is on battery, on breezy-ppc? I didn't file in this bug just because. The undesired behavior occurs consistently every day after using apt-get the preivous evening. Now I commented out updatedb from the cron and I run it manually when I want.

Revision history for this message
Martin Bergner (martin-bergner) wrote :

Is this still a problem on Dapper or Edgy?

Changed in cron:
assignee: nobody → martin-bergner
Revision history for this message
Albert Cardona (cardona) wrote :

I have no idea. My system is heavily customized at the moment to avoid all these pitfalls. Since I need it everyday for work unfortunately I cannot test this. Currently my cron entry for updatedb is commented out.

Revision history for this message
Alexander Menk (alex-menk) wrote :

idea: laptop-mode can be configured to switch of the cron daemon when in battery mode .. perhaps cron jobs should be divided in "important" and "maintenance" .. why isn't laptop-mode installed by default on laptops ?

Changed in cron:
assignee: martin-bergner → nobody
Revision history for this message
Milan Bouchet-Valat (nalimilan) wrote :

Should be fixed in Feisty.

Changed in cron:
status: Incomplete → Fix Released
Revision history for this message
Albert Cardona (cardona) wrote :

It actually is fixed in feisty. I've seen updatedb fire up when I plug the computer to the AC, which is a very good sign.
Thank you for tracking this.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.