can we have a quiet news.daily?

Florian Schlichting fschlich at CIS.FU-Berlin.DE
Mon Nov 9 10:45:04 UTC 2009

Hi Julien,

> However, I do not understand why you only change the scanlogs behaviour
> in news.daily.
> There is also innstat; unless you also use "nostat"?  but I do not think
> it should be related to "nomail".

well, that's right, I am running news.daily with "norenumber nostat
nomail", and didn't look beyond my immediate issue. But I am not sure
what you were trying to say / suggest?

Regarding innstat, its point is to output data, so unless using "nostat"
there will always be something to mail. That is, one could implement
writing its output to a log file similar to expire.log, and not output
anything if "nomail" was used. But I'm not sure how useful logging would
be, as things like disk usage need to be either monitored continuously,
or not at all?

> There are also issues with renumbering and postexec:

This is true. Both preexec and renumbering will output something, and
postexec is even worse, because its output will not be included in the
news.daily mail but always mailed separately!

I think the latter is a bug and postexec should be moved up to take
place before mailing the report.

But would you think that making explanatory output depend on "nomail" /
${DOMAIL} is the right thing to do? Like so:

> ##  Renumber the active file.
> if ${DORENUMBER} ; then
    if ${DOMAIL} ; then
>     echo ''
>     echo 'Renumbering active file.'
> ##  Run any user programs.
> if [ -n "${PROGRAMS}" ] ; then
>    for P in ${PROGRAMS} ; do
       if ${DOMAIL} ; then
>        echo ''
>        echo "${P}:"
>      eval ${P}
>    done
> fi

...and similarly for postexec.

As long as news.daily is run from cron, this is probably what one would
want (and certainly fine by me), but I wonder if we also need to take
into account the case when news.daily is run interactively (like when
cleaning up after a crash or data corruption), and the admin uses
"nomail" to get immediate feedback instead of having to wait for the
whole run to complete and the mail to arrive?

> We should check the correct definition of the variable first:
> -    print "$Title from $first_date to $last_date\n\n";
> +    print "$Title from $first_date to $last_date\n\n"
> +      if ((defined $$h{'default'}{'text'})
> +          and ($$h{'default'}{'text'} =~ m/^true$/io));

You're right. I was mislead by the 'die "Error in config file. Field
'text' is mandatory.\n"' in Write_Results()...


More information about the inn-workers mailing list