Cron service not able to start – Can’t create reboot check file

cron

The cron log at /var/log/cron gives me the following when I reboot the system or manually start cron (with /etc/init.d/cron start command):

Jul  2 10:17:31 monserver /usr/sbin/cron[17386]: (CRON) INFO (pidfile fd = 3)
Jul  2 10:17:31 monserver /usr/sbin/cron[17387]: (CRON) STARTUP (fork ok)
Jul  2 10:17:31 monserver /usr/sbin/cron[17387]: (CRON) DEATH (Can't create reboot check file)

Verified that cron is truly not running with ps aux | grep cron

This server has recently had permissions issues with other applications (nagios for one). I wouldn't be surprised if that's the case here, but I haven't been able to track down the location of this "reboot check file". It's an older Debian system (ver 5.0.2).

Please let me know if more info is required

Best Answer

This is by the way the Debian specific code being triggered. As karmawhore already have stated, it does seem like you have permission problems with /var/run, preventing /var/run/crond.reboot from being created.

#ifdef DEBIAN
#define REBOOT_FILE "/var/run/crond.reboot"
       /* Run on actual reboot, rather than cron restart */
       if (access(REBOOT_FILE, F_OK) == 0) {
               /* File exists, return */
               log_it("CRON", getpid(),"INFO",
                      "Skipping @reboot jobs -- not system startup");
               return;
       }
       /* Create the file */
       if ((rbfd = creat(REBOOT_FILE, S_IRUSR&S_IWUSR)) < 0) {
               /* Bad news, bail out */
               log_it("CRON",getpid(),"DEATH","Can't create reboot check file");
               exit(0);
       } else {
               close(rbfd);
               log_it("CRON", getpid(),"INFO", "Running @reboot jobs");
       }


        Debug(DMISC, ("[%d], Debian running reboot jobs\n",getpid()));

#endif
Related Topic