# cron and LDAP users

**URL:** <https://forums.suse.com/t/cron-and-ldap-users/30531>\
**Category:** SLES Configure-Administer\
**Created:** [November 10, 2017, 3:04pm UTC](https://forums.suse.com/t/cron-and-ldap-users/30531 "2017-11-10T15:04:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbrinkmann](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tbrinkmann](https://forums.suse.com/u/tbrinkmann)\
**Post date:** [November 10, 2017, 3:04pm UTC](https://forums.suse.com/t/cron-and-ldap-users/30531/1 "2017-11-10T15:04:41Z")

</div>

Hi,

we are using local cron with an LDAP user. After a reboot cron does not trigger the scripts configured in /etc/crontab for the ldapuser

- 
  - 
    - 
      - 
        - LdapUser /home/ldapuser/script1.sh

After I restart cron and login/logout the user

#\>su - LdapUser

cron trigger the Jobs.

Can anyone help to understand this behavior ?

\*T

---

<div class="post-metadata">

**Author:** ![smflood](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/smflood/32/10576_2.png) [@smflood](https://forums.suse.com/u/smflood)\
**Post date:** [November 10, 2017, 3:31pm UTC](https://forums.suse.com/t/cron-and-ldap-users/30531/2 "2017-11-10T15:31:01Z")

</div>

On 10/11/17 13:14, tbrinkmann wrote:  
[color=blue]

> we are using local cron with an LDAP user. After a reboot cron does not  
> trigger the scripts configured in /etc/crontab for the ldapuser
> 
> - 
> - 
> - 
> - 
> - LdapUser /home/ldapuser/script1.sh
> 
> After I restart cron and login/logout the user
> 
> #\>su - LdapUser
> 
> cron trigger the Jobs.
> 
> Can anyone help to understand this behavior ?[/color]

I can see from the web view of your post that this is SLES11 SP4. Is  
there a corresponding cron error in /var/log/messages?

## HTH.

Simon  
SUSE Knowledge Partner

* * *

## If you find this post helpful and are logged into the web interface, please show your appreciation and click on the star below. Thanks.

---

<div class="post-metadata">

**Author:** ![ab1](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@ab1](https://forums.suse.com/u/ab1)\
**Post date:** [November 10, 2017, 3:45pm UTC](https://forums.suse.com/t/cron-and-ldap-users/30531/3 "2017-11-10T15:45:52Z")

</div>

Along with Simon’s question, can you tell where cron is in the load order  
relative to other things like the network? In addition, is your box using  
static network configuration, or DHCP, or something that may slow down  
actual acquisition of network information? If any of this is an issue you  
could potentially delay cron startup by having it come later in the load  
order, or by restarting it once in something like boot.local, etc.  
Admittedly those are workarounds for timing issues.

Have you tried setting up the cron jobs as the user themselves? e.g. use  
‘su’ to become the user and then run ‘crontab -e’ and setup the job in  
there (without the user specification after the time spec) and see if that  
behaves any differently.

–  
Good luck.

If you find this post helpful and are logged into the web interface,  
show your appreciation and click on the star below.

If you want to send me a private message, please let me know in the  
forum as I do not use the web interface often.

---

<div class="post-metadata">

**Author:** ![Jens-U](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@Jens-U](https://forums.suse.com/u/Jens-U)\
**Post date:** [November 14, 2017, 4:31pm UTC](https://forums.suse.com/t/cron-and-ldap-users/30531/4 "2017-11-14T16:31:03Z")

</div>

Hi \*T,

how are you accessing the LDAP accounts (PAM, sssd,…) and are these accounts on an OpenLDAP server or from within an AD? If it’s an OpenLDAP server, is it local to the machine?

It does sound as if the account is not available when crond is started - i.e. because of a not yet established access path to the LDAP directory server.

If you’re using sssd, you might mitigate the effect by activating account caching. If using PAM directly, you might look into your nscd configuration to establish the same effect.

Regards,  
J

---

<div class="post-metadata">

**Author:** ![tbrinkmann](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tbrinkmann](https://forums.suse.com/u/tbrinkmann)\
**Post date:** [November 20, 2017, 9:41am UTC](https://forums.suse.com/t/cron-and-ldap-users/30531/5 "2017-11-20T09:41:37Z")

</div>

Hey there thanks for your suggestions,

sorry for the delay some other tasks gets a higher prior.

Lazy workaround, restart cron via cron after a boot.

I Will try to readjust it this week.

\*T
