cron is skipped some runs, leaves error messages in the log 'Job execution of per-minute job schedul

在Red Hat Enterprise Linux中,Cron作业可能因设置时间超过60秒而被跳过,尤其是在依赖网络用户身份服务(如NIS、LDAP、winbind)时。本文探讨了这一问题的根本原因,包括网络延迟、远程服务器问题及高负载下D进程的阻塞,并提供了两种解决方案:一是优化系统的网络基础用户身份服务,二是将Cron作业重构为简单的服务,使其在下一分钟开始前休眠。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

环境

  • Red Hat Enterprise Linux

问题

  • Cron is skipped some runs, leaves following messages in the log

    Raw

       May  3 08:46:01  crond[12709]: (admin) error: Job execution of per-minute job scheduled for 08:45 delayed into
    subsequent minute 08:46. Skipping job run.
    May  3 08:46:01 crond[12709]: CRON (admin) ERROR: cannot set security context
    May  3 08:46:01  crond[12708]: (admin) error: Job execution of per-minute job scheduled for 08:45 delayed into
    subsequent minute 08:46. Skipping job run.
    May  3 08:46:01  crond[12708]: CRON (admin) ERROR: cannot set security context
    

决议

This message is produced if the time taken to setup a per-minute cron job takes longer than 60 seconds.

To resolve either rework the system's network-based user identity services to be reliable/resilient or recode the cron job as a simple service that sleeps until the next minute is reached.

根源

Part of the setup of a cron job is to obtain requisite user, group and selinux information.

If the system configuration relies on non-local services (NIS, LDAP, winbind) for user database information then these lookups can potentially be stalled by high load, network outages or remote server issues. If the delay incurred for all the lookups takes long than 60 seconds the log message will be triggered and the job will not run.

cron job will also take longer than 60 seconds when it is stuck in D process due to high load.

 

转载至https://access.redhat.com/solutions/55189

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值