Gentoo Archives: gentoo-laptop

From: Gabriel Tarantini <gtarantini@×××××.com>
To: gentoo-laptop@l.g.o
Subject: Re: [gentoo-laptop] laptop-mode-tools and updatedb (or cron jobs in general)
Date: Wed, 27 Sep 2006 13:50:45
Message-Id: 245fe42c0609270647if23c08ei78d43a24fc3cf4d9@mail.gmail.com
In Reply to: [gentoo-laptop] laptop-mode-tools and updatedb (or cron jobs in general) by Fred Labrosse
1 Maybe you could create a script that checks the battery state and run
2 the slocate script only if you are running on AC, and put that script
3 on cron.daily, so you don't need to alter system scripts.
4
5 On 9/27/06, Fred Labrosse <ffl@×××××××.uk> wrote:
6 > All,
7 >
8 > I recently discovered laptop-mode-tools and it does replace advantageously the
9 > scripts I had written to respond to acpi events. And it does much more!
10 >
11 > One thing it does not do (nor were my scripts) is turn off things like
12 > updatedb when running on battery. I looked into that and thought about the
13 > various options and here's the result:
14 >
15 > - One could just move the slocate script from and in /etc/cron.daily to
16 > control it running or not. The problem with that approach is that the script
17 > needs to be saved somewhere and then moved (or linked) when it is needed.
18 > Moreover, if people want to run it weekly instead of daily, then the moving
19 > needs to be changed.
20 >
21 > - One could remove the slocate script from /etc/cron.daily (or wherever it is)
22 > and have a line in the crontab file. This has very similar limitations to
23 > the method above.
24 >
25 > - One could have laptop-mode-tools write something like "updatedb=[off|on]" in
26 > some state file (let's say in /var/state) and have the slocate script source
27 > that state file and run or not updatedb based on the value of the defined
28 > variable. This would not have the above limitations and could be applied to
29 > all the cron jobs. However, this would need modifying system scripts,
30 > therefore introducing more work at every update of these.
31 >
32 > I do think that the final method is the way to go to solve that problem and
33 > would be interested in developing/experimenting that.
34 >
35 > Has anybody done anything like that? Is that something that could be
36 > integrated in gentoo at some stage? Do people have
37 > suggestions/comments/criticisms, etc.?
38 >
39 > Cheers,
40 >
41 > Fred
42 > --
43 > gentoo-laptop@g.o mailing list
44 >
45 >
46
47
48 --
49 Those who would repeat the past must control the teaching of history.
50 -Bene Gesserit Coda
51 --
52 gentoo-laptop@g.o mailing list