Package: cron
Version: 3.0pl1-105

If a cron job produces too much output, it will silently fail if no MTA is installed. This issue was reported and confirmed as a bug in Ubuntu (bug #151231 - https://bugs.launchpad.net/ubuntu/+source/cron/+bug/151231) but does not seem to have been reported in Debian because it does not typically manifest itself since an MTA (exim) is almost always installed by default. It can occur on Debian when using it as a VServer guest, since newvserver only installs the bare minimum of packages by default.

Potential workarounds:

1) Define MAITO="" in /etc/default/cron, at the beginning of the crontab, or another applicable location.

2) Redirect stderr output for cron jobs.

3) Limit the amount of output a cron job produces. For example, I encountered the bug when writing a script for svn backups and was able to use svnadmin -q to suppress the output.


From the Ubuntu bug report:

This appears to be well-defined and reproducible. The following cron line:

* * * * * /bin/bash -l -c "cd /home/tim/test && ./runme 2>err"

runs the following script:

#!/bin/bash -x

for (( i=0; i<634; i++ )); do
  printf "."
done

touch got.here

This successfully runs the 'touch' line and creates the file. However, when the "634" is changed to "635", the script fails to run to completion and the 'touch' line never executes. The stderr output indicates that the program terminates during the printf statement.

If I add two characters to the cron command:

* * * * * /bin/bash -l -c "cd /home/tim/./test && ./runme 2>err"

then the threshold drops by two: 632 succeeds, 633 fails.



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to