Debian Bug report logs - #702712
cron: Cron jobs with non-zero exit status no longer include "(failed)" in subject

version graph

Package: cron; Maintainer for cron is Javier Fernández-Sanguino Peña <jfs@debian.org>; Source for cron is src:cron.

Reported by: Eric Pruitt <eric.pruitt@gmail.com>

Date: Sun, 10 Mar 2013 16:15:05 UTC

Severity: normal

Found in version cron/3.0pl1-124

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Javier Fernández-Sanguino Peña <jfs@debian.org>:
Bug#702712; Package cron. (Sun, 10 Mar 2013 16:15:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eric Pruitt <eric.pruitt@gmail.com>:
New Bug report received and forwarded. Copy sent to Javier Fernández-Sanguino Peña <jfs@debian.org>. (Sun, 10 Mar 2013 16:15:07 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Eric Pruitt <eric.pruitt@gmail.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: cron: Cron jobs with non-zero exit status no longer include "(failed)" in subject
Date: Sun, 10 Mar 2013 11:12:49 -0500
Package: cron
Version: 3.0pl1-124
Severity: normal

Hello,

I use procmail to sort my mail, and to make sure failed cron jobs were directed
to my Inbox, I grepped for the expression '^Subject:.*\(failed\)$' in my
emails. After upgrading to Debian Wheezy, I was surprised when I did not see
failed cron jobs in my Inbox from applications I had not yet setup on my new
Debian installation. Upon investigating, I learned that "(failed)" was no
longer being appended to the email subjects of failed cron jobs:

    ~% crontab -l | head -n2
    SHELL="/bin/bash"
    * * * * * echo Test; exit 1
    ~% date
    Sun Mar 10 10:52:50 CDT 2013
    ~% ls -lh ~/mail/.Alerts.Cron/new/*
    -rw-r--r-x 1 jameseric jameseric 751 Mar 10 10:53 /home/jameseric/mail/.Alerts.Cron/new/1362930781.943_0.sinister
    ~% fgrep Subject !$
    fgrep Subject ~/mail/.Alerts.Cron/new/*
    Subject: Cron <jameseric@sinister> echo Test; exit 1

I reviewed "aptitude changelog cron," and I do not see this change mentioned,
and there also does not appear to be an option to enable having the text
appended listed in "man cron."

In reviewing the source code at
http://anonscm.debian.org/gitweb/?p=pkg-cron/pkg-cron.git;a=blob;f=do_command.c#l565,
it appears the text is still there. The "strings" command also shows it present
in my compiled binary:

    ~% strings /usr/sbin/cron | fgrep '(failed)'
     (failed)

So it is not immediately obvious to me why the text is not being appended.

Eric

-- Package-specific info:
--- EDITOR:
not set

--- /usr/bin/editor:
/usr/bin/vim.gtk

--- /usr/bin/crontab:
-rwxr-sr-x 1 root crontab 35880 Jul  3  2012 /usr/bin/crontab

--- /var/spool/cron:
drwxr-xr-x 5 root root 4096 Mar  9 17:16 /var/spool/cron

--- /var/spool/cron/crontabs:
drwx-wx--T 2 root crontab 4096 Mar  9 21:16 /var/spool/cron/crontabs

--- /etc/cron.d:
drwxr-xr-x 2 root root 4096 Mar  9 17:06 /etc/cron.d

--- /etc/cron.daily:
drwxr-xr-x 2 root root 4096 Mar  9 17:17 /etc/cron.daily

--- /etc/cron.hourly:
drwxr-xr-x 2 root root 4096 Mar  9 17:06 /etc/cron.hourly

--- /etc/cron.monthly:
drwxr-xr-x 2 root root 4096 Mar  9 17:06 /etc/cron.monthly

--- /etc/cron.weekly:
drwxr-xr-x 2 root root 4096 Mar 10 03:37 /etc/cron.weekly


-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages cron depends on:
ii  adduser         3.113+nmu3
ii  debianutils     4.3.2
ii  dpkg            1.16.9
ii  libc6           2.13-38
ii  libpam-runtime  1.1.3-7.1
ii  libpam0g        1.1.3-7.1
ii  libselinux1     2.1.9-5
ii  lsb-base        4.1+Debian8

Versions of packages cron recommends:
ii  exim4                                      4.80-7
ii  exim4-daemon-light [mail-transport-agent]  4.80-7

Versions of packages cron suggests:
pn  anacron        <none>
pn  checksecurity  <none>
ii  logrotate      3.8.1-4

Versions of packages cron is related to:
pn  libnss-ldap   <none>
pn  libnss-ldapd  <none>
pn  libpam-ldap   <none>
pn  libpam-mount  <none>
pn  nis           <none>
pn  nscd          <none>

-- no debconf information



Information forwarded to debian-bugs-dist@lists.debian.org, Javier Fernández-Sanguino Peña <jfs@debian.org>:
Bug#702712; Package cron. (Mon, 28 Oct 2013 19:36:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sam Morris <sam@robots.org.uk>:
Extra info received and forwarded to list. Copy sent to Javier Fernández-Sanguino Peña <jfs@debian.org>. (Mon, 28 Oct 2013 19:36:05 GMT) Full text and rfc822 format available.

Message #10 received at 702712@bugs.debian.org (full text, mbox):

From: Sam Morris <sam@robots.org.uk>
To: 702712@bugs.debian.org
Cc: Eric Pruitt <eric.pruitt@gmail.com>
Subject: Use crond -L 5 to get the "(failed)" subject back
Date: Mon, 28 Oct 2013 19:32:25 +0000
[Message part 1 (text/plain, inline)]
This was caused by:

          * do_command.c, cron.h, cron.8: 
            - Change the behaviour when logging the information of the child processes.
              A new loglevel (8) is introduced and documented in cron.8. The previous
              log format is kept unless the sysadmin choses to select this new option.
              (Closes: #637295)

The exit status of jobs is ignored unless log_level &
CRON_LOG_JOBFAILED. Put EXTRA_OPTS='-L 5' into /etc/default/cron and
restart cron and the mails will be fixed.

Regards,

-- 
Sam Morris
https://robots.org.uk/
 
PGP key id 1024D/5EA01078
3412 EA18 1277 354B 991B  C869 B219 7FDB 5EA0 1078
[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 17 22:06:25 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.