[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Mail from cron jobs (Re: design issues in debian packages)



On Wed, Dec 19, 2001 at 10:25:52AM +0100, Russell Coker wrote:

> On Wed, 19 Dec 2001 10:01, Wichert Akkerman wrote:
> > Previously Russell Coker wrote:
> > > No!  Programs that mailbomb root are EVIL.
> >
> > Crap, all programs that mailbomb are evil, but crontabs that mail errors
> > are useful and have been in use for ages. They just need to be careful
> > not to turn into mailbombs, and Matt has nicely done that
> > in the latest upload. Don't force everyone to install logcheck just
> > because you don't want emails from cron.
> 
> Logcheck installation isn't forced.  If someone doesn't want to install 
> logcheck then they can use whatever other proceedures they want for viewing 
> logs and then take appropriate action.  Other system programs in common use 
> such as named only send errors to syslog not email, so why should this be 
> different?
>
> Sending lots of mail is bad.  For small end-user systems such as Brian's 
> there is no guarantee that mail will be read before the disk fills up (lots 
> of people don't read mail to root).

When this bug was reported against Cricket (#119137) I sent a copy of my
response to debian-devel to get some feedback on whether there was a
consensus on how to do this, but nobody expressed any opinions.  I guess it
takes a couple of good flame wars and a subject line like "design issues in
debian packages" to get people's attention.  A copy of that message is now
attached because it works here too.

I decided that the MAILTO method has the fewest outright disadvantages, and
it easiest for the user to adjust to their liking.  If you want to use
logcheck, get mail at any address, etc. you can make all of those changes in
one place, the cron.d conffile.

-- 
 - mdz
--- Begin Message ---
On Sun, Nov 11, 2001 at 03:11:56PM +0000, Mark Brown wrote:

> cricket installs a cron job to collect stats and do updates.  With some
> errors this will generate output to stdout and/or stderr.  Since there's
> no other configuration cron then delivers this output to the cricket
> user where it's likely to get ignored.
> 
> The cron.d file ought to redirect the output elsewhere - specifying a
> target for mail or redirecting the output to a log file somewhere.

There doesn't seem to be a consensus on the right way to do this.

- Add an alias to /etc/aliases pointing to root, and let the user change it
  if they want.  This is what postgres and several other programs do

- Prompt the user for an address, and add that to /etc/aliases.  Hylafax
  does this.

- Set MAILTO in the cron.d snippet, pointing to root, and allow the user to
  change it (it's a conffile)

- Just pass through error output along with normal output to the logfile.
  This was the approach taken by previous versions of the cricket package,
  before collect-subtrees was used (which has the ability to filter errors).
  This has the disadvantage that there is no asynchronous notification of
  errors.

- Leave things the way they are, and expect the user to alias cricket
  appropriately.  This doesn't seem like a good idea.

Policy doesn't seem to specify any particular behavior, though it might be a
good idea for it to do so.

-- 
 - mdz

--- End Message ---

Reply to: