Cron 工作不再有效

use*_*337 2 cron

Cron 作业过去已经工作了几个月,但最近我的服务器负载很高,现在 cron 作业没有执行我的 php 文件(与之前工作的相同)。当我检查 cron 日志时,我看到了这一点,我认为这与问题有关:

(CRON) EXEC FAILED (/usr/sbin/sendmail): Resource temporarily unavailable

我需要做什么来解决这个问题?我正在运行 CentOS 7。

编辑:我将此标记为已回答,因为我认为进程挂起导致了此问题。今天,我醒来,同样的问题发生了。我想知道是什么原因造成的。

在 cron 日志中,我看到:

Oct 11 05:01:01 run-parts(/etc/cron.hourly)[25431]: starting 0anacron
Oct 11 05:01:01 run-parts(/etc/cron.hourly)[25444]: finished 0anacron
Oct 11 05:01:01 run-parts(/etc/cron.hourly)[25431]: starting 0yum-hourly.cron
Oct 11 05:01:01 run-parts(/etc/cron.hourly)[25450]: finished 0yum-hourly.cron
Oct 11 05:01:01 CROND[25434]: (CRON) EXEC FAILED (/usr/sbin/sendmail): Resource temporarily unavailable
Oct 11 05:01:01 CROND[25429]: (apache) MAIL (mailed 71 bytes of output but got status 0x0001
Run Code Online (Sandbox Code Playgroud)

更新:

我注意到我的邮件日志中出现了两件事。

Oct  8 14:01:39 postfix/local[12886]: 5180C2D098A5: to=<N@mail.domain.com>, orig_to=<N>, relay=local, delay=1.1, delays=0.07/0.01/0/1, dsn=5.1.1, status=bounced (unknown user: "n")
Oct  9 04:19:10 postfix/local[12452]: C8F762D012D6: to=<root@mail.domain.com>, orig_to=<apache>, relay=local, delay=0.22, delays=0.13/0.02/0/0.07, dsn=5.2.0, status=bounced (cannot update mailbox /var/mail/root for user root. cannot open file: Is a directory)
Run Code Online (Sandbox Code Playgroud)

Pau*_*xie 5

(CRON) EXEC FAILED (/usr/sbin/sendmail): 资源暂时不可用

这不是 cron 问题。来自 exec(3):

 The execl(), execle(), execlp(), execvp() and execvP() functions may fail
 and set errno for any of the errors specified for the library functions
 execve(2) and malloc(3).
Run Code Online (Sandbox Code Playgroud)

从 execve(2):

 [ENOMEM]           The new process requires more virtual memory than is
                    allowed by the imposed maximum (getrlimit(2)).
Run Code Online (Sandbox Code Playgroud)

来自 malloc(3):

   ENOMEM
       Memory allocation error.
Run Code Online (Sandbox Code Playgroud)

在大多数 UNIX 系统上,任何失控的进程都会消耗足够的资源,导致非失控进程的正常虚拟内存分配也失败。

这不是 cron 问题,而是系统资源、利用率或调整问题。