5

I have cron jobs in cPanel that are scheduled every night. Yesterday, I noticed that these cron jobs haven't run since 2 days ago. I checked the cron log in /var/log/cron, and it shows me errors when trying to access the file.

Errors:

Nov  6 11:25:01 web2 crond[17439]: (laptoplc) ERROR (failed to change user)
Nov  6 11:25:01 web2 crond[17447]: (projecto) ERROR (failed to change user)
Nov  6 11:25:01 web2 crond[17446]: (CRON) ERROR (setreuid failed): Resource temporarily unavailable
Nov  6 11:25:01 web2 crond[17446]: (laptoppa) ERROR (failed to change user)

What could be the problem?

hopper
  • 13,060
  • 7
  • 49
  • 53
Alan
  • 75
  • 1
  • 2
  • 12

3 Answers3

6

There could be several things caused this. Here are ways to debug your crons:

  1. Run it manually from shell:

    php yourcron.php

  2. Add logging from your cron file, maybe by adding error_log('check if running'); to see if it is indeed running.

As suggested above it could be permission issue too. Add execute permission to your cron:

chmod 755 yourcron.php
jaycode
  • 2,926
  • 5
  • 35
  • 71
1

Check whether any Zombie processes for these users exist using the below command.

ps -eLF |grep -i username

Try killing those processes and check whether cronjobs are running after that.

sudo ps -eLF |grep username |awk '{print $2}' |xargs sudo kill -9 

Dont kill any important running process !

Marcus Rickert
  • 4,138
  • 3
  • 24
  • 29
-1

I had a similar problem today. The cron in /var/spool/cron/userXXX had a script for /home/userYYY (another user) and so this error occurred. I removed the line that had userYYY and this was resolved.

André
  • 21
  • 4