FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 03-14-2009, 09:28 AM
Adeodato Simó
 
Default One-time cron output?

Hello,

I wanted to gather some opinions on this matter. I’ve recently applied
to the mlocate package a patch I received to skip running the daily
update of the database if the system is running on batteries.

When that happens, the daily cron script emits a warning like “System on
battery power, not running updatedb.” I think it’s going to be bad
emitting that warning each time mlocate skips running updatedb, because
it could be a lot of times.

On the other hand, I don’t like the idea of being completely silent,
because the database could go un-updated for a long time without the
user ever knowing why.

I’d like to make the script check for the existence of a file like
/var/lib/mlocate/on_battery_warning_done.touch, and only emit the
warning if it does not exist (and then touch it). (And possibly prefix
the warning with the words “One-time warning:”.)

Does this sound appropriate, or does it sound like an overkill? If it
doesn’t sound appropriate, do you think always emitting the warning, or
never emitting it, is more appropriate?

Thanks,

--
- Are you sure we're good?
- Always.
-- Rory and Lorelai


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 03-14-2009, 01:54 PM
Andreas Metzler
 
Default One-time cron output?

Adeodato Sim <dato@net.com.org.es> wrote:
> I wanted to gather some opinions on this matter. I've recently applied
> to the mlocate package a patch I received to skip running the daily
> update of the database if the system is running on batteries.

> When that happens, the daily cron script emits a warning like "System on
> battery power, not running updatedb." I think it's going to be bad
> emitting that warning each time mlocate skips running updatedb, because
> it could be a lot of times.

> On the other hand, I don't like the idea of being completely silent,
> because the database could go un-updated for a long time without the
> user ever knowing why.
[...]

IMHO the right thing to would be for mlocate (in locate mode, not in
updatedb mode) to issue a warning if the DB was too old instead of the
way you suggested.

cu andreas
--
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 03-14-2009, 10:50 PM
Ben Hutchings
 
Default One-time cron output?

On Sat, 2009-03-14 at 11:28 +0100, Adeodato Simó wrote:
> Hello,
>
> I wanted to gather some opinions on this matter. I’ve recently applied
> to the mlocate package a patch I received to skip running the daily
> update of the database if the system is running on batteries.
[...]

I think such a policy should be implemented by the cron daemon or by a
common script, rather than by each package with a cron job.

Ben.

--
Ben Hutchings
Humour is the best antidote to reality.
 
Old 03-15-2009, 07:31 AM
Raphael Hertzog
 
Default One-time cron output?

On Sat, 14 Mar 2009, Andreas Metzler wrote:
> Adeodato Sim <dato@net.com.org.es> wrote:
> > I wanted to gather some opinions on this matter. I've recently applied
> > to the mlocate package a patch I received to skip running the daily
> > update of the database if the system is running on batteries.
>
> > When that happens, the daily cron script emits a warning like "System on
> > battery power, not running updatedb." I think it's going to be bad
> > emitting that warning each time mlocate skips running updatedb, because
> > it could be a lot of times.
>
> > On the other hand, I don't like the idea of being completely silent,
> > because the database could go un-updated for a long time without the
> > user ever knowing why.
> [...]
>
> IMHO the right thing to would be for mlocate (in locate mode, not in
> updatedb mode) to issue a warning if the DB was too old instead of the
> way you suggested.

Why only in locate mode? It does this already AFAIK but it doesn't tell
the user why it's old.

Sending the warning only when updatedb is skipped and when the DB is
already quite old seems like a good compromise.

Cheers,
--
Raphal Hertzog

Contribuez Debian et gagnez un cahier de l'admin Debian Lenny :
http://www.ouaza.com/wp/2009/03/02/contribuer-a-debian-gagner-un-livre/


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 03-15-2009, 09:12 AM
Adeodato Sim
 
Default One-time cron output?

As an extra idea, on IRC Peter Palfrader suggested never skipping the
warning, but always sending it to syslog rather than stderr.

--
- Are you sure we're good?
- Always.
-- Rory and Lorelai


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 03-15-2009, 12:05 PM
gregor herrmann
 
Default One-time cron output?

On Sun, 15 Mar 2009 11:12:39 +0100, Adeodato Sim wrote:

> As an extra idea, on IRC Peter Palfrader suggested never skipping the
> warning, but always sending it to syslog rather than stderr.

Adding a NEWS.Debian file about the changed behaviour might be helpful too.

Cheers,
gregor
--
.'`. Home: http://info.comodo.priv.at/{,blog/} / GPG Key ID: 0x00F3CFE4
: :' : Debian GNU/Linux user, admin, & developer - http://www.debian.org/
`. `' Member of VIBE!AT, SPI Inc., fellow of FSFE | http://got.to/quote/
`- NP: Tina Turner: Private Dancer
 

Thread Tools




All times are GMT. The time now is 11:34 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org