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 1145080

Summary: Jobs won't run; crond states bad username
Product: Red Hat Enterprise Linux 7 Reporter: Marcela Mašláňová <mmaslano>
Component: cronieAssignee: Tomas Mraz <tmraz>
Status: CLOSED ERRATA QA Contact: Robin Hack <rhack>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: emajorsi, extras-qa, jhrozek, john, jscotka, lnykryn, mmaslano, pertusus, rhack, terje.rosten, tmraz, trailtotale
Target Milestone: rcKeywords: EasyFix, Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cronie-1.4.11-14.el7 Doc Type: Bug Fix
Doc Text:
Prior to this update, cron jobs of users whose account information was acquired from the Lightweight Directory Access Protocol (LDAP) server might not run after the system boot, and the "bad username" error was logged. The handling of accounts that are temporarily missing from the system due to loss of contact with the LDAP server has been improved with a patch, and the error no longer occurs in this situation.
Story Points: ---
Clone Of: 1067236 Environment:
Last Closed: 2015-07-27 09:29:49 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:
Bug Depends On: 1067236    
Bug Blocks:    

Description Marcela Mašláňová 2014-09-22 10:47:51 UTC
+++ This bug was initially created as a clone of Bug #1067236 +++

Description of problem:
I have cron jobs that must run as usernames that only exist in LDAP.  I see the "bad username" error because crond can be started before the LDAP server is reachable.  The LDAP server is distinct from the server with the cron job.  The issue is especially troublesome when both servers are VMs on the same host and booting up together.

Version-Release number of selected component (if applicable):
cronie-1.4.11-4.fc20.x86_64

How reproducible:
always

Steps to Reproduce:
1. create a cron job with a username that only exists in LDAP
2. stop crond and the LDAP server (or otherwise make it unreachable)
3. start crond
4. start the LDAP server (or make it available again)

Actual results:
Logs show "crond[PID]: (CRON) bad username (/etc/cron.d/JOBNAME)


Expected results:
Ideally crond would periodically retry to establish the username identities each time the job comes due again, if they weren't already successfully established.

Additional info:

Patch:
Cronie is missing this in unit file:
After=nss-user-lookup.target

Also sssd should be fixed:
--- Additional comment from Jakub Hrozek on 2014-09-17 10:59:34 CEST ---

We added:

Before=systemd-user-sessions.service nss-user-lookup.target
Wants=nss-user-lookup.target

Very recently to sssd, as a matter of fact I just pushed that build to stable (it's sssd-1.11.6-3).

Comment 4 errata-xmlrpc 2015-07-27 09:29:49 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://rhn.redhat.com/errata/RHBA-2015-1501.html