Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Previously, when MAILTO recipients were set in the /etc/sysconfig/packagekit-background file, the /etc/cron.daily/packagekit-background.cron script only checked for the return value from the pkcon command before trying to send email reports. As a consequence, two unnecessary empty emails were sent under certain circumstances. With this update, the $PKTMP file is not attempted to be sent by email if the files is empty, and only emails with useful information are now sent in the described scenario.
Created attachment 966217[details]
patch to ensure that the $PKTMP file is not attempted to be sent by mail if the files is empty
Description of problem:
When setting MAILTO recipients in /etc/sysconfig/packagekit-background /etc/cron.daily/packagekit-background will only check for the return value from the pkcon command before trying to send email reports. In the case that the pkcon has not output any message(s) to the temporary file named by $PKTMP in the script, the mail command is invoked trying to send a null message body as a report. Anacron will also send a mail with the warning from the mail command, "
Null message body; hope that's ok".
In short, if MAILTO is set in /etc/sysconfig/packagekit-background and if pkcon returns anything else but return value 5 (nothing useful done) and at the same time does not output any warnings or error messages, two unneccessary emails are sent.
Version-Release number of selected component (if applicable):
PackageKit-cron-0.5.8-23.el6.x86_64
How reproducible:
Daily.
Steps to Reproduce:
1. Set MAILTO in /etc/sysconfig/packagekit-background
2. Wait
3. Two emails are sent, from /etc/cron.daily/packagekit-background and anacron. None of these carry any useful information.
Actual results:
Useless unneccessary emails are sent
Expected results:
Only email with useful info should be sent from /etc/cron.daily/packagekit-background.cron
Additional info:
patch to use bash built-in test -s to check if $PKTMP actually contains information:
--- /etc/cron.daily/packagekit-background.cron 2014-05-20 15:31:02.000000000 +0200
+++ /etc/cron.daily/packagekit-background.cron.fix 2014-12-09 13:13:48.067878542 +0100
@@ -36,13 +36,16 @@
# this is when seomthing useful was done
if [ $PKCON_RETVAL -ne 5 ]; then
+ # Do we actually have something to report? Is $PKTMP non-empty?
+ if [ -s $PKTMP ]; then
# send email
if [ -n "$MAILTO" ]; then
- mail -s "System updates available: $SYSTEMNAME" $MAILTO < $PKTMP
+ mail -s "System updates available: $SYSTEMNAME" $MAILTO < $PKTMP
else
# default behavior is to use cron's internal mailing of output from cron-script
- cat $PKTMP
+ cat $PKTMP
fi
+ fi
fi
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://rhn.redhat.com/errata/RHBA-2015-1352.html
Created attachment 966217 [details] patch to ensure that the $PKTMP file is not attempted to be sent by mail if the files is empty Description of problem: When setting MAILTO recipients in /etc/sysconfig/packagekit-background /etc/cron.daily/packagekit-background will only check for the return value from the pkcon command before trying to send email reports. In the case that the pkcon has not output any message(s) to the temporary file named by $PKTMP in the script, the mail command is invoked trying to send a null message body as a report. Anacron will also send a mail with the warning from the mail command, " Null message body; hope that's ok". In short, if MAILTO is set in /etc/sysconfig/packagekit-background and if pkcon returns anything else but return value 5 (nothing useful done) and at the same time does not output any warnings or error messages, two unneccessary emails are sent. Version-Release number of selected component (if applicable): PackageKit-cron-0.5.8-23.el6.x86_64 How reproducible: Daily. Steps to Reproduce: 1. Set MAILTO in /etc/sysconfig/packagekit-background 2. Wait 3. Two emails are sent, from /etc/cron.daily/packagekit-background and anacron. None of these carry any useful information. Actual results: Useless unneccessary emails are sent Expected results: Only email with useful info should be sent from /etc/cron.daily/packagekit-background.cron Additional info: patch to use bash built-in test -s to check if $PKTMP actually contains information: --- /etc/cron.daily/packagekit-background.cron 2014-05-20 15:31:02.000000000 +0200 +++ /etc/cron.daily/packagekit-background.cron.fix 2014-12-09 13:13:48.067878542 +0100 @@ -36,13 +36,16 @@ # this is when seomthing useful was done if [ $PKCON_RETVAL -ne 5 ]; then + # Do we actually have something to report? Is $PKTMP non-empty? + if [ -s $PKTMP ]; then # send email if [ -n "$MAILTO" ]; then - mail -s "System updates available: $SYSTEMNAME" $MAILTO < $PKTMP + mail -s "System updates available: $SYSTEMNAME" $MAILTO < $PKTMP else # default behavior is to use cron's internal mailing of output from cron-script - cat $PKTMP + cat $PKTMP fi + fi fi