Marco Gaiarin wrote:
> Bob Proulx wrote:
> > Please, one thread for each bug.  This is a different problem and it
> > should have a different bug ticket.
> 
> I consider the ''bug'' as: «squeeze /etc/cron.daily/spamassassin is a
> bit more verbose/annoying then lenny one», and sa-exim only a ''side
> effect'' of that.

Okay.  I have filed Bug#689076 to hold discussion about the mirror problem.

  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=689076

> Probably i've understimated this, but i think that cronjobs have (to
> try) to be as quiter as possible, because are mostly unreadable and
> confusing.

I can agree that the errors are terrible to understand.  The original
authors could have made them nicer.  But redirecting all errors to
/dev/null does not solve the problem.  It just ignores it.

In this case one of the mirrors is having a problem.  Let's say that
there were two mirrors.  The other mirror would handle the load and
everything will continue to work.  But then what happens if that other
mirror has an error?  We don't want to fail and ignore that error.

> AFAI've understood the script, it try insted to ''pass over'' to catch
> errors, and if an error occur, restart the update with ''--lint'' to
> make a better informative ''log''.

Most of the time that is reasonable.  However some of the time I will
have problems behave differently the second time around.  When there
is a network dependent error for example.  In those cases it will lead
to the confusing case of a report of a failure but the detail listing
showing a success.  Therefore I believe it is always better to save
the full output and if there is an error then report it without
running anything a second time.  This way the real details are
reported and it is less confusing.  It is more trouble to write it
that way though.

> All my ''example patch'' say that, other than error, there's also some
> warnings (or not so understood errors ;).

I looked at your patch and here are the changes from it:

  -        sa-compile --quiet
  +        sa-compile --quiet > /dev/null 2>&1
  -       invoke-rc.d spamassassin reload > /dev/null
  +       invoke-rc.d spamassassin reload > /dev/null 2>&1
  -       /etc/init.d/spamassassin reload > /dev/null
  +       /etc/init.d/spamassassin reload > /dev/null 2>&1
  -        spamassassin --lint || die_with_lint
  +        spamassassin --lint > /dev/null 2>&1 || die_with_lint

What I see there is that in every case all of the output is redirected
to /dev/null ignoring all output include any errors that are produced.

> I don't know very well SA, so i don't know if the error handling are
> excellent or poor, and so, if the warning can be safely ignored (as
> i've done in my patch) or taken into account.

Okay.  But I do not believe it is appropriate to ignore those errors.

> For me, give to the users the choice to ignore warnings or send them,
> eg, redirecting all output of scripts to a file, check if it was empty
> and eventually send to the user (better, filtering with a regexp).

I would not be opposed to an *option* to ignore all errors.  But it
should not be the default.

I am not proposing this next but if you want the script to stop
producing any output then at the top of the script you could install
this one single line and it would in one place redirect all of the
output for the entire rest of the script without needing to change
many individual lines.

  exec >/dev/null 2>&1

Put that near the top of the script such as immediately after the
"#!/bin/sh" line and it will redirect output for the rest of the file.

Bob

Attachment: signature.asc
Description: Digital signature

Reply via email to