环境
- Red Hat Enterprise Linux
问题
-
Cron is skipped some runs, leaves following messages in the log
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.
- 产品(第)
- Red Hat Enterprise Linux