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 1846665

Summary: /etc/cron.daily/rhsmd killing wrong rhsmd process.
Product: Red Hat Enterprise Linux 7 Reporter: Kurt Bechstein <bkurt>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED DUPLICATE QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.8CC: alsanche, alsouza, baptiste.agasse, martin.dedek, negativo17, patrick.andrieux, redakkan, ronald.verbeek
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-30 10:02:28 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 Kurt Bechstein 2020-06-12 14:01:01 UTC
Description of problem:
I first reported this in bug 1803794 and was asked to create a new bug.  The problem is that the /etc/cron.daily/rhsmd script it not killing off the rhsmd process that it is supposed to kill off.  Here are the lines of the script that are the issue:

 12 /usr/libexec/rhsmd -s &
 13 sleep $rhsmd_timeout;
 14
 15 ps_check=$(pgrep -f '/usr/libexec/rhsmd')
 16 if [ -n "$ps_check" ]; then
 17   pkill -f '/usr/libexec/rhsmd' >/dev/null 2>&1
 18   logger -t rhsmd -p user.warn "rhsmd process exceeded runtime and was killed." >/dev/null 2>&1
 19 fi

On line 12 the rhsmd process is started and then the script sleeps for the process timeout amount from the config file.  What we have observed is that the rhsmd process exits in just a few seconds typically.  After the sleep the script looks for a /usr/libexec/rhsmd process and if it finds one it kills it.  It doesn't do any validation that the rhsmd process it is killing is the one it started initially which is the intent.  Instead it kills the process and then in all of our 7.8 systems we now see the following in the syslog output:

Jun  5 03:26:02 testhost1 rhsmd: rhsmd process exceeded runtime and was killed.
Jun  5 03:26:05 testhost1 dbus[778]: [system] Activating service name='com.redhat.SubscriptionManager' (using servicehelper)
Jun  5 03:26:05 testhost1 dbus[778]: [system] Successfully activated service 'com.redhat.SubscriptionManager'



Version-Release number of selected component (if applicable):
subscription-manager-1.24.26-3.el7_8.x86_64

How reproducible:  This happens on our RHEL 7.8 systems everyone morning in the logs.


Steps to Reproduce:
1.Wait until script runs
2.Observer output in the log files.
3.

Actual results:


Expected results:
I would expect the script would track the pid of the rhsmd process it starts and only kill that process off rather than blindly killing off all rhsmd processes on the system.


Additional info:

Comment 2 Ronald 2020-07-15 09:00:43 UTC
Our release 7.8 server still have this issue every morning.

Comment 3 Martin Dedek 2020-07-16 07:44:51 UTC
All our 7.8 servers emit every day message "rhsmd: rhsmd process exceeded runtime and was killed".

Comment 5 alsanche 2020-08-07 15:08:17 UTC
Hello team, 

Is there an update on this bug? I have a customer who has been waiting for a resolution. 

Kind regards, 

Alejandro Sanchez

Comment 6 Kurt Bechstein 2020-08-07 15:12:39 UTC
We are in the same boat as the previous post.  What is the status of this please?

Comment 7 Ronald 2020-08-11 09:59:15 UTC
Yesterday our RHEL server updated subscription manager packages:
subscription-manager-gui-1.24.26-4.el7_8.x86_64
subscription-manager-initial-setup-addon-1.24.26-4.el7_8.x86_64
subscription-manager-rhsm-certificates-1.24.26-4.el7_8.x86_64
subscription-manager-plugin-container-1.24.26-4.el7_8.x86_64
subscription-manager-rhsm-1.24.26-4.el7_8.x86_64
subscription-manager-1.24.26-4.el7_8.x86_64

But this morning still the same message: rhsmd process exceeded runtime and was killed.

Comment 8 Rehana 2020-09-30 10:02:28 UTC
Thanks for opening the bug , we find this bug as a close match to bug 1850919 . Hence closing this bug as a duplicate. 

We will be working on providing a fix for this issue in the next 3 months. 

thanks,
Rehana

*** This bug has been marked as a duplicate of bug 1850919 ***