Cron 작업이 더 이상 작동하지 않습니다.

Cron 작업이 더 이상 작동하지 않습니다.

Cron 작업은 과거 몇 달 동안 작동했지만 최근에는 서버 부하가 높아서 이제 cron 작업이 내 PHP 파일(이전 작업과 동일한 파일)을 실행하지 않습니다. cron 로그를 확인하면 문제와 관련이 있다고 생각되는 내용이 표시됩니다.

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

이 문제를 해결하려면 어떻게 해야 합니까? CentOS 7을 실행 중입니다.

편집하다:프로세스 중단으로 인해 이 문제가 발생한다고 생각하여 이를 답변으로 표시했습니다. 오늘 일어났더니 같은 문제가 발생했습니다. 이 문제의 원인이 무엇인지 궁금합니다.

크론 로그에 다음이 표시됩니다.

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

업데이트:

내 메일 로그에서 이상해 보이는 두 가지 사항을 발견했습니다.

Oct  8 14:01:39 postfix/local[12886]: 5180C2D098A5: to=<[email protected]>, 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=<[email protected]>, 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)

답변1

(CRON) EXEC FAILED(/usr/sbin/sendmail): 리소스를 일시적으로 사용할 수 없습니다.

이것은 크론 문제가 아닙니다. 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).

execve(2)에서:

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

malloc(3)에서:

   ENOMEM
       Memory allocation error.

대부분의 UNIX 시스템에서 모든 런어웨이 프로세스는 런어웨이가 아닌 프로세스에 의한 정상적인 가상 메모리 할당도 실패하게 만들만큼 충분한 리소스를 소비할 수 있습니다.

이는 크론 문제가 아니라 시스템 리소스, 활용도 또는 튜닝 문제입니다.

관련 정보