Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 290201 - updatedb on laptop starts, even when AC power is unplugged
Summary: updatedb on laptop starts, even when AC power is unplugged
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-23 07:09 UTC by Kai Dietrich
Modified: 2009-10-24 08:58 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
/etc/cron.daily/slocate (slocate,459 bytes, text/plain)
2009-10-23 07:10 UTC, Kai Dietrich
Details
/etc/cron.daily/slocate (slocate,458 bytes, text/plain)
2009-10-23 07:17 UTC, Kai Dietrich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Dietrich 2009-10-23 07:09:10 UTC
When a laptop doesn't have AC power plugged in, the /etc/cron.daily/slocate job should not start because it takes alot of power from the battery. Also the updatedb job should start niced and, if possible even ioniced. I created a modified /etc/cron.daily/slocate script for myself and just wanted it to share. I don't know if the acpi/AC power detection works on all laptops, just wanted to share the idea.

Reproducible: Always

Steps to Reproduce:
1. unplug ac power
2. wait until updatedb cronjob starts
Comment 1 Kai Dietrich 2009-10-23 07:10:52 UTC
Created attachment 207962 [details]
/etc/cron.daily/slocate

/etc/cron.daily/slocate which starts updatedb whith ionice and nice and doesn't start updatedb at all when ac-power is unplugged
Comment 2 Kai Dietrich 2009-10-23 07:17:17 UTC
Created attachment 207963 [details]
/etc/cron.daily/slocate

reversed defaults for fault tolerance
Comment 3 SpanKY gentoo-dev 2009-10-24 08:58:31 UTC
Comment on attachment 207963 [details]
/etc/cron.daily/slocate

except the ACSTATEFILE you use is not universal.  some people have multiple AC's.  look at the latest openrc code as an example.