Bug 1823780

Summary: /etc/cron.daily/rhsmd gives error sleep: missing operand [rhel-7.8.z]
Product: Red Hat Enterprise Linux 7 Reporter: RAD team bot copy to z-stream <autobot-eus-copy>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: medium Docs Contact:
Priority: high    
Version: 7.9CC: akrherz, alsanche, apmukher, asakpal, candlepin-bugs, cdonnell, csnyder, cww, jgamba, jonathan.rosa, jreznik, jsefler, kagarwal, kkinge, kupadhya, kwalker, matthew.f.ludwig, m.a.young, mhoward, mvanderw, nrm, pkonst+RHBZ, ramkumar, rbeyel, redakkan, rhsm-qe, shughes, sshashi, vchepkov, vinzenz.meier, voetelink, wpoteat
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.24.26-2.el7_8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1803794 Environment:
Last Closed: 2020-05-12 18:40:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1803794    
Bug Blocks:    

Description RAD team bot copy to z-stream 2020-04-14 13:47:41 UTC
This bug has been copied from bug #1803794 and has been proposed to be backported to 7.8 z-stream (EUS).

Comment 5 Rehana 2020-04-24 14:47:23 UTC
*** Bug 1824961 has been marked as a duplicate of this bug. ***

Comment 6 John Sefler 2020-04-27 21:35:12 UTC
Verification Testing...

Demonstrating the original failure on RHEL-7.8 with no processtimeout configuration in /etc/rhsm/rhsm.conf...
[root@intel-chiefriver-02 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.8 (Maipo)
[root@intel-chiefriver-02 ~]# rpm -q subscription-manager
subscription-manager-1.24.26-1.el7.x86_64
[root@intel-chiefriver-02 ~]# 
[root@intel-chiefriver-02 ~]# grep --ignore-case processtimeout /etc/rhsm/rhsm.conf
[root@intel-chiefriver-02 ~]# 
[root@intel-chiefriver-02 ~]# /etc/cron.daily/rhsmd
sleep: missing operand
Try 'sleep --help' for more information.
/etc/cron.daily/rhsmd: line 19: 22829 Terminated              /usr/libexec/rhsmd -s
[root@intel-chiefriver-02 ~]# 

BANG! Original "sleep: missing operand" failure reproduced.


Now I will upgrade (steps not shown) to the latest RHEL-7.8z stream build of subscription-manager and re-test
[root@intel-chiefriver-02 ~]# rpm -q subscription-manager
subscription-manager-1.24.26-3.el7_8.x86_64
[root@intel-chiefriver-02 ~]# rpm -q --changelog subscription-manager | grep 1823780
- 1823780: corrected missing quotes for config check; ENT-2010
[root@intel-chiefriver-02 ~]# 
[root@intel-chiefriver-02 ~]# grep --ignore-case processtimeout /etc/rhsm/rhsm.conf
[root@intel-chiefriver-02 ~]# 
[root@intel-chiefriver-02 ~]# /etc/cron.daily/rhsmd
[root@intel-chiefriver-02 ~]# 

VERIFIED: No more "sleep: missing operand" error.

In fact, a processtimeout of 5 minutes (300 seconds) was used as re-demonstrated below using "time" to show that when processtimeout is absent from the /etc/rhsm/rhsm.conf (which can occur during an upgrade situation), the /etc/cron.daily/rhsmd process will take 5 minutes to timeout...

[root@intel-chiefriver-02 ~]# grep --ignore-case processtimeout /etc/rhsm/rhsm.conf
[root@intel-chiefriver-02 ~]# 
[root@intel-chiefriver-02 ~]# subscription-manager config | grep --ignore-case processtimeout
   processtimeout = [300]
[root@intel-chiefriver-02 ~]# 
[root@intel-chiefriver-02 ~]# time /etc/cron.daily/rhsmd

real	5m0.034s
user	0m0.182s
sys	0m0.065s
[root@intel-chiefriver-02 ~]# 

VERIFIED: The /etc/cron.daily/rhsmd job will timeout after the default 5 minutes (the square braces in the config report indicates a default value).

Comment 11 errata-xmlrpc 2020-05-12 18:40:21 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:2101