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.

Bug 1752059

Summary: [rhel78] System gets mail report when cron.daily is run and the list continue to grow
Product: Red Hat Enterprise Linux 7 Reporter: Rehana <redakkan>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.8CC: cdonnell, csnyder
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.24.19-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-31 19:40:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rehana 2019-09-13 15:07:47 UTC
Description of problem:


Version-Release number of selected component (if applicable):
subscription management server: 2.7.5-1
subscription management rules: 5.37
subscription-manager: 1.24.17-1.el7


How reproducible:
every day 

Steps to Reproduce:
1.wait for cron.daily to run 
2.Message " You have new mail in /var/spool/mail/root "
3.
[root@kvm-07-guest37 ~]# cat /var/spool/mail/root 
From root.lab.eng.bos.redhat.com  Mon Sep  9 06:25:07 2019
Return-Path: <root.lab.eng.bos.redhat.com>
Received: from kvm-07-guest37.hv2.lab.eng.bos.redhat.com (localhost [127.0.0.1])
	by kvm-07-guest37.hv2.lab.eng.bos.redhat.com (8.14.7/8.14.7) with ESMTP id x89AP780020452
	for <root.lab.eng.bos.redhat.com>; Mon, 9 Sep 2019 06:25:07 -0400
Received: (from root@localhost)
	by kvm-07-guest37.hv2.lab.eng.bos.redhat.com (8.14.7/8.14.7/Submit) id x89AP776020451
	for root; Mon, 9 Sep 2019 06:25:07 -0400
Date: Mon, 9 Sep 2019 06:25:07 -0400
Message-Id: <201909091025.x89AP776020451.lab.eng.bos.redhat.com>
From: Anacron <root.lab.eng.bos.redhat.com>
To: root.lab.eng.bos.redhat.com
Content-Type: text/plain; charset="UTF-8"
Subject: Anacron job 'cron.daily' on kvm-07-guest37.hv2.lab.eng.bos.redhat.com

/etc/cron.daily/rhsmd:

 9799 ?        Sl     0:00 /usr/bin/python /usr/libexec/rhsmd
20429 ?        SN     0:00 /bin/sh /etc/cron.daily/rhsmd

From root.lab.eng.bos.redhat.com  Tue Sep 10 03:29:01 2019
Return-Path: <root.lab.eng.bos.redhat.com>
Received: from kvm-07-guest37.hv2.lab.eng.bos.redhat.com (localhost [127.0.0.1])
	by kvm-07-guest37.hv2.lab.eng.bos.redhat.com (8.14.7/8.14.7) with ESMTP id x8A7T1OR021731
	for <root.lab.eng.bos.redhat.com>; Tue, 10 Sep 2019 03:29:01 -0400
Received: (from root@localhost)
	by kvm-07-guest37.hv2.lab.eng.bos.redhat.com (8.14.7/8.14.7/Submit) id x8A7T1no021730
	for root; Tue, 10 Sep 2019 03:29:01 -0400
Date: Tue, 10 Sep 2019 03:29:01 -0400
Message-Id: <201909100729.x8A7T1no021730.lab.eng.bos.redhat.com>
From: Anacron <root.lab.eng.bos.redhat.com>
To: root.lab.eng.bos.redhat.com
Content-Type: text/plain; charset="UTF-8"
Subject: Anacron job 'cron.daily' on kvm-07-guest37.hv2.lab.eng.bos.redhat.com

/etc/cron.daily/rhsmd:

21707 ?        SN     0:00 /bin/sh /etc/cron.daily/rhsmd

From root.lab.eng.bos.redhat.com  Wed Sep 11 03:36:01 2019
Return-Path: <root.lab.eng.bos.redhat.com>
Received: from kvm-07-guest37.hv2.lab.eng.bos.redhat.com (localhost [127.0.0.1])
	by kvm-07-guest37.hv2.lab.eng.bos.redhat.com (8.14.7/8.14.7) with ESMTP id x8B7a1Pk022682
	for <root.lab.eng.bos.redhat.com>; Wed, 11 Sep 2019 03:36:01 -0400
Received: (from root@localhost)
	by kvm-07-guest37.hv2.lab.eng.bos.redhat.com (8.14.7/8.14.7/Submit) id x8B7a1Rp022681
	for root; Wed, 11 Sep 2019 03:36:01 -0400
Date: Wed, 11 Sep 2019 03:36:01 -0400
Message-Id: <201909110736.x8B7a1Rp022681.lab.eng.bos.redhat.com>
From: Anacron <root.lab.eng.bos.redhat.com>
To: root.lab.eng.bos.redhat.com
Content-Type: text/plain; charset="UTF-8"
Subject: Anacron job 'cron.daily' on kvm-07-guest37.hv2.lab.eng.bos.redhat.com

/etc/cron.daily/rhsmd:

22658 ?        SN     0:00 /bin/sh /etc/cron.daily/rhsmd

From root.lab.eng.bos.redhat.com  Thu Sep 12 03:11:01 2019
Return-Path: <root.lab.eng.bos.redhat.com>
Received: from kvm-07-guest37.hv2.lab.eng.bos.redhat.com (localhost [127.0.0.1])
	by kvm-07-guest37.hv2.lab.eng.bos.redhat.com (8.14.7/8.14.7) with ESMTP id x8C7B1cp023664
	for <root.lab.eng.bos.redhat.com>; Thu, 12 Sep 2019 03:11:01 -0400
Received: (from root@localhost)
	by kvm-07-guest37.hv2.lab.eng.bos.redhat.com (8.14.7/8.14.7/Submit) id x8C7B1dV023663
	for root; Thu, 12 Sep 2019 03:11:01 -0400
Date: Thu, 12 Sep 2019 03:11:01 -0400
Message-Id: <201909120711.x8C7B1dV023663.lab.eng.bos.redhat.com>
From: Anacron <root.lab.eng.bos.redhat.com>
To: root.lab.eng.bos.redhat.com
Content-Type: text/plain; charset="UTF-8"
Subject: Anacron job 'cron.daily' on kvm-07-guest37.hv2.lab.eng.bos.redhat.com

/etc/cron.daily/rhsmd:

23641 ?        SN     0:00 /bin/sh /etc/cron.daily/rhsmd

From root.lab.eng.bos.redhat.com  Fri Sep 13 03:51:02 2019
Return-Path: <root.lab.eng.bos.redhat.com>
Received: from kvm-07-guest37.hv2.lab.eng.bos.redhat.com (localhost [127.0.0.1])
	by kvm-07-guest37.hv2.lab.eng.bos.redhat.com (8.14.7/8.14.7) with ESMTP id x8D7p26h024925
	for <root.lab.eng.bos.redhat.com>; Fri, 13 Sep 2019 03:51:02 -0400
Received: (from root@localhost)
	by kvm-07-guest37.hv2.lab.eng.bos.redhat.com (8.14.7/8.14.7/Submit) id x8D7p2rk024924
	for root; Fri, 13 Sep 2019 03:51:02 -0400
Date: Fri, 13 Sep 2019 03:51:02 -0400
Message-Id: <201909130751.x8D7p2rk024924.lab.eng.bos.redhat.com>
From: Anacron <root.lab.eng.bos.redhat.com>
To: root.lab.eng.bos.redhat.com
Content-Type: text/plain; charset="UTF-8"
Subject: Anacron job 'cron.daily' on kvm-07-guest37.hv2.lab.eng.bos.redhat.com

/etc/cron.daily/rhsmd:

24796 ?        Sl     0:00 /usr/bin/python /usr/libexec/rhsmd
24901 ?        SN     0:00 /bin/sh /etc/cron.daily/rhsmd

Actual results:
Receive mail report every day

Expected results:
Suggest to make sure we dont spam the system and make sure the rhsmd process is run executed successfully 

Additional info:

Comment 2 Craig Donnelly 2019-09-13 15:39:16 UTC
The output that is being mailed is from `ps` output for the new eval in the script:

24796 ?        Sl     0:00 /usr/bin/python /usr/libexec/rhsmd
24901 ?        SN     0:00 /bin/sh /etc/cron.daily/rhsmd

Working on fixing it now by changing how its checked.

Comment 5 Rehana 2019-10-30 09:09:15 UTC
Verifying on :
--------------
# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.9.17-1
subscription management rules: 5.37
subscription-manager: 1.24.23-1.el7

[root@kvm-01-guest18 ~]# rpm -qa subscription-manager --changelog | grep 1752059
- 1752059: corrected cron receving stdout mail for rhsmd run (crag)

Wait for the cron.daily to run and check the system 

# tail -f /var/log/cron 
Oct 30 03:34:01 kvm-01-guest18 run-parts(/etc/cron.daily)[9473]: starting rhsmd
Oct 30 03:39:01 kvm-01-guest18 run-parts(/etc/cron.daily)[9516]: finished rhsmd
Oct 30 03:39:01 kvm-01-guest18 anacron[9469]: Job `cron.daily' terminated
Oct 30 03:39:01 kvm-01-guest18 anacron[9469]: Normal exit (1 job run)

[root@kvm-01-guest18 ~]# cat /etc/cron.daily/rhsmd
#!/bin/sh
# nightly run of rhsmd to log entitlement expiration/validity errors to syslog
# this is a cron job because it doesn't need to 'phone home'. should that
# change, look into calling the dbus interface from rhsmcertd instead.
config=$(grep -E "^processTimeout" /etc/rhsm/rhsm.conf | grep -Po "[0-9]+")
if [ -n $config ]; then
  rhsmd_timeout=$config
else
  rhsmd_timeout=300
fi

/usr/libexec/rhsmd -s &
sleep $rhsmd_timeout;

ps_check=$(pgrep -f '/usr/libexec/rhsmd')
if [ -n "$ps_check" ]; then
  pkill -f '/usr/libexec/rhsmd' >/dev/null 2>&1
  logger -t rhsmd -p user.warn "rhsmd process exceeded runtime and was killed." >/dev/null 2>&1
fi

[root@kvm-01-guest18 ~]# cat /var/spool/mail/root 
cat: /var/spool/mail/root: No such file or directory
[root@kvm-01-guest18 ~]# 


There was no mails on the system, based on the above observations moving the bug to verified

Comment 7 errata-xmlrpc 2020-03-31 19:40:52 UTC
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://access.redhat.com/errata/RHBA-2020:1028