Your message dated Tue, 19 Jun 2018 20:53:46 +0000
with message-id <[email protected]>
and subject line Bug#899397: fixed in cron-apt 0.13.0
has caused the Debian Bug report #899397,
regarding cron-apt: mail subject never indicates error on completion
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.)


-- 
899397: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=899397
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: cron-apt
Version: 0.10.0
Severity: minor

Dear Ola,

/usr/share/cron-apt/functions contains an error (cf. code extract
below): The mail subject never will be "... error on ..." (line 103)
because the error file tested for existance gets deleted beforehand
(line 84ff.).  Thus one cannot trust mails like "completed on..."

I've solved the issue by moving the "if -f ... rm -f ..." clean-up below
the mail command (cf. patch below).

/usr/share/cron-apt/functions:
 84     if [ -f "$ERROR" ] ; then
 85         rm -f "$ERROR"
 86     fi
 87     if [ -f "$RUNSYSLOG" ] ; then
 88         rm -f "$RUNSYSLOG"
 89     fi
 90     if [ -f "$RUNERROR" ] ; then
 91         rm -f "$RUNERROR"
 92     fi
 93     if [ -f "$RUNMAIL" ] ; then
 94         rm -f "$RUNMAIL"
 95     fi
 96     if [ -f "$MAIL" ] && [ "$MAILON" != "never" ] && [ -n "$MAILON" ] ; then
 97         if command -v sendmail >/dev/null; then
 98             HDR="To: $MAILTO"
 99             if [ -z "$HOSTNAME" ]; then
100                 HOSTNAME="$(uname -n)"
101             fi
102             if [ -f "$ERROR" ] ; then
103                 HDR=$(printf "$HDR\nSubject: CRON-APT error on $HOSTNAME 
[$CONFIG]")
104             else
105                 HDR=$(printf "$HDR\nSubject: CRON-APT completed on 
$HOSTNAME [$CONFIG]")
106             fi

--- /tmp/functions      2018-05-23 19:54:05.000000000 +0200
+++ /usr/share/cron-apt/functions       2018-05-23 19:56:36.875793315
+0200
@@ -81,9 +81,6 @@
     if [ -f "$RUNLOG" ] ; then
        rm -f "$RUNLOG"
     fi
-    if [ -f "$ERROR" ] ; then
-       rm -f "$ERROR"
-    fi
     if [ -f "$RUNSYSLOG" ] ; then
        rm -f "$RUNSYSLOG"
     fi
@@ -123,6 +120,9 @@
     if [ -f "$DIFF" ] ; then
        rm -f "$DIFF"
     fi
+    if [ -f "$ERROR" ] ; then
+       rm -f "$ERROR"
+    fi
     if [ -d "$TMPDIR" ] ; then
        rmdir "$TMPDIR"
     fi


BTW, one could move all clean-up code ("if -f ... rm -f ...") below the
mail function in order to prevent similar bugs when extending the mail
function with other variables in the future.

Thank you in advance for merging the patch into mainline version -- and
for spending your free time as debian developer.


Best regards -- Sebastian

-- System Information:
Debian Release: 9.4
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-6-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages cron-apt depends on:
ii  apt  1.4.8

Versions of packages cron-apt recommends:
ii  cron [cron-daemon]                 3.0pl1-128+deb9u1
ii  liblockfile1                       1.14-1+b1
ii  nullmailer [mail-transport-agent]  1:1.13-1.2

cron-apt suggests no packages.

-- Configuration Files:
/etc/cron-apt/action.d/0-update [Errno 2] No such file or directory: 
'/etc/cron-apt/action.d/0-update'
/etc/cron-apt/action.d/3-download [Errno 2] No such file or directory: 
'/etc/cron-apt/action.d/3-download'
/etc/cron-apt/config changed [not included]
/etc/cron.d/cron-apt changed [not included]

-- no debconf information

--- End Message ---
--- Begin Message ---
Source: cron-apt
Source-Version: 0.13.0

We believe that the bug you reported is fixed in the latest version of
cron-apt, which is due to be installed in the Debian FTP archive.

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.
Ola Lundqvist <[email protected]> (supplier of updated cron-apt 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: SHA256

Format: 1.8
Date: Tue, 19 Jun 2018 22:03:39 +0200
Source: cron-apt
Binary: cron-apt
Architecture: source all
Version: 0.13.0
Distribution: unstable
Urgency: low
Maintainer: Ola Lundqvist <[email protected]>
Changed-By: Ola Lundqvist <[email protected]>
Description:
 cron-apt   - automatic update of packages using apt-get
Closes: 899397
Changes:
 cron-apt (0.13.0) unstable; urgency=low
 .
   * Correction so that error can be shown in email subject.
     Closes: #899397. Thanks to Sebastian Klamar for the patch.
Checksums-Sha1:
 3d7aa8d47c8efbfc34a2ef346f91700a192889ed 1426 cron-apt_0.13.0.dsc
 076e93c7e906218cc4b540bbd48b2c2e1962df2a 44873 cron-apt_0.13.0.tar.gz
 92aa1bbd879b9f67b521ffdc3c9a3e155ad1b5b2 27074 cron-apt_0.13.0_all.deb
 ba934464238ba2c23ddf809449514743e8fe40e3 5655 cron-apt_0.13.0_amd64.buildinfo
Checksums-Sha256:
 5ceb5df9310280124821ee9448242b758cb64968e78d444772e609680210962b 1426 
cron-apt_0.13.0.dsc
 26bf79d1035d6e0befa62c23f0de10d3b98834e1c4c6e5a168fa1d09bae84157 44873 
cron-apt_0.13.0.tar.gz
 ae3fe2e0c3a95ffe2721062c648fe03ccd03bd4f4492793240fb10b8f5773ae9 27074 
cron-apt_0.13.0_all.deb
 8e43039f51cfed5a0e2e54b7cde75169f507f0b55df0f649834c5647c0f9ca17 5655 
cron-apt_0.13.0_amd64.buildinfo
Files:
 1f68019a6634a2cc83e39f848290c03b 1426 admin optional cron-apt_0.13.0.dsc
 0262ec83c65aabcf11a40f166cf6ee24 44873 admin optional cron-apt_0.13.0.tar.gz
 1f243455299a8fce23e5d0824681b395 27074 admin optional cron-apt_0.13.0_all.deb
 4acf8343092d5ead8d3330143c9083ff 5655 admin optional 
cron-apt_0.13.0_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEIvIyxrHg9L8rJgpqXpDc+pQmh28FAlspZSAACgkQXpDc+pQm
h2+7uhAAnYuaDqXuHkabLsTltPZjrRFDMGcsoQm6fVYXv9dGdvarptcwEQBvu/Y+
tdfMJRZO6jE+9bkb0tZrScG21p8Hn2zLdLrrwM1j3ZxMe9T1sfuKD8hXZscpqshJ
189ZQrIfS9VugBKgCmnxxQaT5U5oKY41bHizgg5yIezQRhSXX11vwyMVA9WzgQPr
qMMBCDa8RMKX+8oEb64oOTw0rrurWH/fbdUotPvadSdc0OZD6u66zayh07RpU4AK
XrWvFkG3ypoAyKnnj8G1Q4ScNK+fu3grRXKKgnB5tieF7H9qbtvnoP1JypmjevFg
XlnjwvDgq7aFB2MBcFiKTp7OQ5pz92WXl9IF7ILGgxpmPrhkSCKXbiLmLm2Iqt5m
2ZDggFqb+HtNAuWgIovV/WjvyfIbmQEC3QTOnN2woK3VfRqln8KKhHi47WyjtbV0
Lk35LuED9c/Eb5HGFPmsOEuvM+RSvIqqOvgRWmO36SVRjDEZp8FIY8KXgXZw5sKY
UYJHQvdnwTSHku6fRIAGyD/ag4Ngts7unmMMT9VrbGPNTxZeAFY5QbOiEeLGggSK
c+3AxchU1PP4Nj1ZIKd3PMfnggaFy5pEpHK8hsOHOsvrp9eUNrdsjHFjOsjGcBDo
I6eTJDNM5YCaqE4iEfyQs0RJP6LKfyrf9u+dT5LpDwqCF/xqFhc=
=Q91x
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to