Why is my cron daemon is being killed every few minutes? OpenVZ?

Posted by user113215 on Server Fault See other posts from Server Fault or by user113215
Published on 2012-06-28T23:32:42Z Indexed on 2012/06/29 3:17 UTC
Read the original article Hit count: 497

Filed under:
|
|
|
|

As of about a week ago, my cron daemon refuses to stay running. I'm using Debian 6. Running something like pgrep cron shows that the daemon isn't running. I start the service with service cron start or /etc/init.d/cron start and it launches, but it disappears from the running process list after a few minutes (varying anywhere between 1 - 30 minutes before the process is killed again).

Using strace -f service cron start, I can see that the process is being killed for some reason:

nanosleep({56, 0}, 0x7fffa7184c80)      = 0
stat("crontabs", {st_mode=S_IFDIR|S_ISVTX|0730, st_size=4096, ...}) = 0
stat("/etc/crontab", {st_mode=S_IFREG|0644, st_size=1100, ...}) = 0
stat("/etc/cron.d", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/etc/cron.d/php5", {st_mode=S_IFREG|0644, st_size=475, ...}) = 0
stat("/etc/cron.d/anacron", {st_mode=S_IFREG|0644, st_size=244, ...}) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGCHLD, NULL, {0x4036f0, [CHLD], SA_RESTORER|SA_RESTART, 0x2b0e8465f230}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
nanosleep({60, 0},  <unfinished ...>
+++ killed by SIGKILL +++

There's nothing relevant in /var/log/syslog, /var/log/messages, /var/log/auth.log, or /var/log/kern.log to explain why the the process is dying. The system has about 500 MB of free memory, and cat /proc/loadavg returns 0.10 0.21 0.45 so resources shouldn't be the issue. I also tried removing and reinstalling the cron package using apt-get. What else should I check? How do I find out what's killing my crond?

Edit: I'm on a virtual machine under OpenVZ (and as such, I have no swap). With cron running, free -m reports:

             total       used       free     shared    buffers     cached
Mem:          1024        465        558          0          0          0
-/+ buffers/cache:        465        558
Swap:            0          0          0

My OpenVZ User Beancounters via cat /proc/user_beancounters:

Version: 2.5
       uid  resource                     held              maxheld              barrier                limit              failcnt
   172087:  kmemsize                  8275718             25561636             51200000             51200000                    0
            lockedpages                     0                  968                 2048                 2048                    0
            privvmpages                113442               266465               262200               262200              3740757
            shmpages                      788                 4004               128000               128000                    0
            dummy                           0                    0                    0                    0                    0
            numproc                        39                   98                  600                  600                    0
            physpages                   50521               208434                    0  9223372036854775807                    0
            vmguarpages                     0                    0               512000               512000                    0
            oomguarpages                50521               208447               512000               512000                    0
            numtcpsock                      7                  323                 4096                 4096                    0
            numflock                        7                   64                 2048                 2048                    0
            numpty                          1                    4                   32                   32                    0
            numsiginfo                      0                   23                 1024                 1024                    0
            tcpsndbuf                  137984             17878480             20480000             20480000                    0
            tcprcvbuf                  114688              6983504             20480000             20480000                    0
            othersockbuf               162960              1074440             20480000             20480000                    0
            dgramrcvbuf                     0                24208             10240000             10240000                    0
            numothersock                  101                  353                 2048                 2048                    0
            dcachesize                 459171               747444             10240000             10240000                    0
            numfile                      1010                 4221                50000                50000                    0
            dummy                           0                    0                    0                    0                    0
            dummy                           0                    0                    0                    0                    0
            dummy                           0                    0                    0                    0                    0
            numiptent                      39                  424                 2048                 2048                    0

© Server Fault or respective owner

Related posts about debian

Related posts about cron