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 1794653 - /etc/cron.daily/rhsmd gives error sleep: missing operand
Summary: /etc/cron.daily/rhsmd gives error sleep: missing operand
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.2
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: 8.0
Assignee: candlepin-bugs
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks: 1803794
TreeView+ depends on / blocked
 
Reported: 2020-01-24 09:07 UTC by Michael Young
Modified: 2023-09-07 21:35 UTC (History)
8 users (show)

Fixed In Version: subscription-manager-1.26.11-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1803794 (view as bug list)
Environment:
Last Closed: 2020-04-28 16:54:53 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin subscription-manager pull 2218 0 None closed 1794653: corrected missing quotes for config check; ENT-2010 2020-09-22 05:08:16 UTC
Red Hat Issue Tracker RHELPLAN-37456 0 None None None 2023-02-12 20:46:27 UTC
Red Hat Product Errata RHBA-2020:1849 0 None None None 2020-04-28 16:55:13 UTC

Description Michael Young 2020-01-24 09:07:19 UTC
I am getting an error from the /etc/cron.daily/rhsmd cron job in subscription-manager-1.26.9-1.el8.x86_64 on RHEL 8.2 beta. The error message is

/etc/cron.daily/rhsmd:

sleep: missing operand
Try 'sleep --help' for more information.
/etc/cron.daily/rhsmd: line 19:  8215 Terminated
/usr/libexec/rhsmd -s

I believe this is because I don't have a processTimeout line in /etc/rhsm/rhsm.conf so $config from line 5 is the empty string
However the if clause starting at line 6 is 
if [ -n $config ]; then
  rhsmd_timeout=$config
else
  rhsmd_timeout=300
fi

so line 6 test is now
if [ -n ]; then
which is true so rhsmd_timeout is set to the empty string
I think line 6 should be
if [ -n "$config" ]; then
so the line 6 would be
if [ -n "" ]; then
which is false so rhsmd_timeout gets set to 300 as intended

Comment 4 Shwetha Kallesh 2020-03-12 12:35:43 UTC
Reproducer :

[root@kvm-guest-02 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 2.9.21-1
subscription management rules: 5.37
subscription-manager: 1.26.9-1.el8


[root@kvm-guest-02 ~]# run-parts /etc/cron.daily
/etc/cron.daily/rhsmd:

sleep: missing operand
Try 'sleep --help' for more information.
/etc/cron.daily/rhsmd: line 19:  5007 Terminated              /usr/libexec/rhsmd -s
[root@kvm-guest-02 ~]# cat /etc/rhsm/rhsm.conf | grep process
# The time in seconds we will allow the rhsmd cron job to run before terminating the process.

Comment 5 Shwetha Kallesh 2020-03-12 12:37:34 UTC
Verification:

[root@kvm-08-guest19 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 2.9.21-1
subscription management rules: 5.37
subscription-manager: 1.26.14-1.el8


[root@kvm-08-guest19 ~]# cat /etc/rhsm/rhsm.conf | grep process
# The time in seconds we will allow the rhsmd cron job to run before terminating the process.

[root@kvm-08-guest19 ~]# run-parts /etc/cron.daily
[root@kvm-08-guest19 ~]#

Comment 9 errata-xmlrpc 2020-04-28 16:54:53 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:1849


Note You need to log in before you can comment on or make changes to this bug.