• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1074
  • Last Modified:

cron failure

i'm using centos linux, and my cronjob for webalizer stop working 12 hours ago after the appearance of STAT FAILED.

What could be wrong?

here are the entries of /etc/var/log/cron:

tail -n 20 cron

Mar 26 03:01:01 scd crond[27819]: (root) CMD (/root/dowebalizer >>/dev/null 2>&1)
Mar 26 03:24:01 scd crond[22031]: (root) CMD (run-parts /etc/cron.hourly)
Mar 26 04:01:01 scd crond[9470]: (root) CMD (/root/dowebalizer >>/dev/null 2>&1)
Mar 26 04:24:01 scd crond[1876]: (root) CMD (run-parts /etc/cron.hourly)
Mar 26 05:01:01 scd crond[5695]: (root) CMD (/root/dowebalizer >>/dev/null 2>&1)
Mar 26 05:24:01 scd crond[32629]: (root) CMD (run-parts /etc/cron.hourly)
Mar 26 05:43:01 scd crond[18196]: (root) CMD (run-parts /etc/cron.daily)
Mar 26 06:01:01 scd crond[18049]: (root) CMD (/root/dowebalizer >>/dev/null 2>&1)
Mar 26 06:24:01 scd crond[5891]: (root) CMD (run-parts /etc/cron.hourly)
Mar 26 07:01:01 scd crond[7841]: (root) CMD (/root/dowebalizer >>/dev/null 2>&1)
Mar 26 07:24:01 scd crond[27982]: (root) CMD (run-parts /etc/cron.hourly)
Mar 26 08:01:01 scd crond[27990]: (root) CMD (/root/dowebalizer >>/dev/null 2>&1)
Mar 26 08:24:01 scd crond[17824]: (root) CMD (run-parts /etc/cron.hourly)
Mar 26 09:01:01 scd crond[3637]: (root) CMD (/root/dowebalizer >>/dev/null 2>&1)
Mar 26 09:24:01 scd crond[11816]: (root) CMD (run-parts /etc/cron.hourly)
Mar 26 10:01:01 scd crond[22331]: (root) CMD (/root/dowebalizer >>/dev/null 2>&1)
Mar 26 10:24:01 scd crond[19693]: (root) CMD (run-parts /etc/cron.hourly)
Mar 26 11:01:01 scd crond[26335]: (root) CMD (/root/dowebalizer >>/dev/null 2>&1)
Mar 26 11:23:01 scd crond[1573]: (CRON) STAT FAILED (cron)
Mar 27 00:58:55 scd crontab[17689]: (root) LIST (root)
0
jay28lee
Asked:
jay28lee
  • 3
  • 3
  • 2
  • +1
2 Solutions
 
NopiusCommented:
Hi.

Probably your root crontab file  "/var/spool/cron/root" is missing.
Check is it there.

Regards,
Arty
0
 
NopiusCommented:
Also check existance (both should exist) and directory permissions on
/etc/cron.d/
/etc/cron.hourly/

directories and on all files below.
Check that file /etc/crontab exists is readable and non empty (and that all directories mentioned inside do exist).


0
 
jay28leeAuthor Commented:
/var/spool/cron/root does exist

as well we the following (but empty)
/etc/cron.d/
/etc/cron.hourly/

/etc/crontab is there too with entries.

i just did a ps command and i didn't see the crond there, is there a way to find out what's the cause of it to stop?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
KlaasdezwartCommented:
do not edit this crontab file directly, it won't reload it automatically
use   contab -l   to list the contents
and use crontab  -e  to edit the file
this is a basic vi editing
0
 
NopiusCommented:
> i just did a ps command and i didn't see the crond there, is there a way to find out what's the cause of it to stop?

Find a  crond.core file (somewhere in your filesystem), open it in debugger and analyze the failure (that's not an easy task).


You can restart crond service with 'service crond restart' command
Sometimes (at least from my experience) crond may fail if the system is overloaded (say ~80 load average value) and all memory is exhausted. System load can be checked with 'uname -a', free memory can be checked with 'top'.

Regards,
Arty
0
 
jay28leeAuthor Commented:
'uname -a' only linux version...SMP....and x86_64 information, there's no indicate with system load?

after consulting with my vps hosting, there's an indication of hitting the resource hitting a resource limit for kernel memory.

how do i monitor the value of kernel memory limit, and how do i raise its value?

what's a good indication to set the proper values?

under 'free' and 'top' i'm always having 90% ~ 95% free memory, it doesn't seem to be the cause of hitting the limit.
0
 
mifurman1947Commented:
check your roor directory
df /

try to start :
service crond start
It give you message if you have problem with memory.
0
 
jay28leeAuthor Commented:
i know how to restart crond, my hosting provider has already narrowed down to the cause of the issue is due hitting the resource limit for kernel memory.

now i need to know how do check the value of kernel memory limit, and how do i raise its value?
0
 
mifurman1947Commented:
There is memory limit for Linux:

cat /proc/sys/kernel/shmmax

To change limit to 16GB:
sysctl -w kernel.shmmax=17179869184
or
echo 17179869184 >/proc/sys/kernel/shmmax
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now