Your message dated Wed, 19 May 2010 12:17:10 +0000
with message-id <[email protected]>
and subject line Bug#580672: fixed in awstats 6.9.5~dfsg-3
has caused the Debian Bug report #580672,
regarding awstats: Show error messages from cron jobs (update.sh and 
buildstatic.sh)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
580672: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=580672
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: awstats
Version: 6.9.5~dfsg-2
Severity: wishlist
Tags: patch


The scripts run from the awstats cron job (update.sh and
buildstatic.sh) do not report any errors because stdout is redirected
to /dev/null.  Therefore it is difficult to track down why awstats is
not generating its database files.

Attached is a patch that allows these scripts to report the error
message in an email from cron whenever the awstats.pl program exits
with a non-zero status.

Detail: TMPFILE is used to record the output of awstats and
awstats_buildstaticpages.pl (from both stdout and stderr).  If the
return status of awstats/awstats_buildstaticpages.pl is nonzero, then
an error occurred and the content of TMPFILE is printed to stderr to
show up in a cron email report.

Note that a failure of awstats.pl/awstats_buildstaticpages.pl due to a
bad config file will now no longer stop it from processing additional
config files; update.sh/buildstatic.sh will continue to run
awstats.pl/awstats_buildstaticpages.pl on other config files.  This
feature has both good and bad consequences: an error in a single
config file will not interrupt processing of the remaining config
files (good); but an error in awstats.local.conf (which is included in
all config files) will generate a repeated error message for multiple
config files (bad).  I think the good outweighs the bad, but if you
think that update.sh/buildstatic.sh should stop after the first error,
then you can add "exit 1" after "cat $TMPFILE >&2" in both scripts.

-- System Information:
Debian Release: 5.0.4
  APT prefers stable
  APT policy: (500, 'stable'), (50, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages awstats depends on:
ii  perl                     5.10.0-19lenny2 Larry Wall's Practical Extraction 

Versions of packages awstats recommends:
ii  libnet-xwhois-perl            0.90-3     Whois Client Interface for Perl5

Versions of packages awstats suggests:
pn  apache2 | httpd            <none>        (no description available)
pn  libgeo-ipfree-perl         <none>        (no description available)
pn  libnet-dns-perl            <none>        (no description available)
pn  libnet-ip-perl             <none>        (no description available)
ii  liburi-perl                1.35.dfsg.1-1 Manipulates and accesses URI strin

-- no debconf information
>From cf0fa60b4d7279d6dc3deae071a0ff9555823e40 Mon Sep 17 00:00:00 2001
From: Ken Neighbors <[email protected]>
Date: Wed, 28 Apr 2010 09:54:58 -0700
Subject: Show error messages from cron jobs (update.sh and buildstatic.sh).

---
 debian/buildstatic.sh |   12 +++++++++---
 debian/update.sh      |    9 +++++++--
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/debian/buildstatic.sh b/debian/buildstatic.sh
index 91dd4d9..9f41cbc 100755
--- a/debian/buildstatic.sh
+++ b/debian/buildstatic.sh
@@ -16,6 +16,7 @@ 
BUILDSTATICPAGES=/usr/share/awstats/tools/awstats_buildstaticpages.pl
 
 cd /etc/awstats
 
+TMPFILE=`mktemp /tmp/awstats.XXXXXXXXXX`
 for c in awstats \
          `/bin/ls -1 awstats.*.conf 2>/dev/null | \
           /bin/sed 's/^awstats\.\(.*\)\.conf/\1/'`
@@ -24,11 +25,16 @@ do
   m=`date +%m`
   mkdir -p /var/cache/awstats/$c/$Y/$m/
   AL=${AWSTATS_LANG:-en}
-  $BUILDSTATICPAGES \
+  if ! $BUILDSTATICPAGES \
     -config=$c \
        -year=$Y \
        -month=$m \
        -lang=$AL \
        -staticlinksext=${AL}.html \
-       -dir=/var/cache/awstats/$c/$Y/$m/
-done >/dev/null
+       -dir=/var/cache/awstats/$c/$Y/$m/ >$TMPFILE 2>&1
+  then
+    # an error occurred
+    cat $TMPFILE >&2
+  fi
+done
+rm -f $TMPFILE
diff --git a/debian/update.sh b/debian/update.sh
index bd49d5d..11a8e03 100755
--- a/debian/update.sh
+++ b/debian/update.sh
@@ -14,9 +14,14 @@ AWSTATS=/usr/lib/cgi-bin/awstats.pl
 
 cd /etc/awstats
 
+TMPFILE=`mktemp /tmp/awstats.XXXXXXXXXX`
 for c in awstats \
          `/bin/ls -1 awstats.*.conf 2>/dev/null | \
           /bin/sed 's/^awstats\.\(.*\)\.conf/\1/'`
 do
-  $AWSTATS -config=$c -update
-done >/dev/null
+  if ! $AWSTATS -config=$c -update >$TMPFILE 2>&1; then
+    # an error occurred
+    cat $TMPFILE >&2
+  fi
+done
+rm -f $TMPFILE
-- 
1.5.6.5


--- End Message ---
--- Begin Message ---
Source: awstats
Source-Version: 6.9.5~dfsg-3

We believe that the bug you reported is fixed in the latest version of
awstats, which is due to be installed in the Debian FTP archive:

awstats_6.9.5~dfsg-3.debian.tar.gz
  to main/a/awstats/awstats_6.9.5~dfsg-3.debian.tar.gz
awstats_6.9.5~dfsg-3.dsc
  to main/a/awstats/awstats_6.9.5~dfsg-3.dsc
awstats_6.9.5~dfsg-3_all.deb
  to main/a/awstats/awstats_6.9.5~dfsg-3_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jonas Smedegaard <[email protected]> (supplier of updated awstats package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Format: 1.8
Date: Wed, 19 May 2010 13:53:50 +0200
Source: awstats
Binary: awstats
Architecture: source all
Version: 6.9.5~dfsg-3
Distribution: unstable
Urgency: low
Maintainer: Debian AWStats Team <[email protected]>
Changed-By: Jonas Smedegaard <[email protected]>
Description: 
 awstats    - powerful and featureful web server log analyzer
Closes: 350601 572353 580672 580692 580693 580704
Changes: 
 awstats (6.9.5~dfsg-3) unstable; urgency=low
 .
   [ Sergey B Kirpichev ]
   * Show error messages from cron jobs.
     Closes: bug#580672, thanks to Ken Neighbors.
   * Add option to disable nightly generation of static html reports.
     Closes: bug#580692, thanks to Ken Neighbors.
   * Option to use "nice" to lower the priority of cron scripts.
     Closes: bug#580693, thanks to Ken Neighbors.
   * Set default language (en) for static reports generation
   * Cosmetic improvements to cron scripts.
     Closes: bug#580704.
   * Recognize method/protocol RTSP in uppercase.
     Closes: bug#350601, thanks to Lee Maguire.
   * Report permissions problem while reading awstats.custom.conf.
     Closes: bug#572353, thanks to Ken Neighbors.
 .
   [ Jonas Smedegaard ]
   * Reverse test logic when sourcing /etc/default/awstats to not fail if
     missing.
   * Respect TMPDIR for temporary files (i.e. use mktemp --tmpdir).
   * Update patches:
     + Drop (unapplied) patch 0011: applied upstream at some point in the
       past.
     + Unfuzz (unapplied) patch 0006.
     + Refresh patches 0006, 1015 and 1016 with compacting quilt options
       --no-index --no-timestamps -pab.
Checksums-Sha1: 
 65a0d00a9556356e27dbdddb70edba3dc1ce665c 1429 awstats_6.9.5~dfsg-3.dsc
 b6c4129ec07aac5e7d792c7ac97705243ea4d6aa 38727 
awstats_6.9.5~dfsg-3.debian.tar.gz
 191e157a51391c33478e3993f182ee550b324a3a 985542 awstats_6.9.5~dfsg-3_all.deb
Checksums-Sha256: 
 de94426295c62a1af0e2e2dbaf85e9d889201c6dfc5b94a03ca2da28c2cba657 1429 
awstats_6.9.5~dfsg-3.dsc
 2ded3ecf7e153309212a930a7f07d32080281024c8bcf165d64bae57bb2c4dc8 38727 
awstats_6.9.5~dfsg-3.debian.tar.gz
 c23a39f8ffdc118e2a65c5fb8199e7d20af65a65a77dc6313606cc1e5e99bc07 985542 
awstats_6.9.5~dfsg-3_all.deb
Files: 
 968b45d3f5f2692fa27c655abb51181e 1429 web optional awstats_6.9.5~dfsg-3.dsc
 b1f694a01ae50cb3dffb00ecec9887d9 38727 web optional 
awstats_6.9.5~dfsg-3.debian.tar.gz
 72d7e584ae477da97a4105e2feeb15ed 985542 web optional 
awstats_6.9.5~dfsg-3_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEAREDAAYFAkvz1IMACgkQn7DbMsAkQLiN7gCgp5n+ZuhPc29u8JYadtHz8lnu
6ecAoJHDbvbUWMK/1WHfk1QSoSRvTCoJ
=WRTw
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to