I am maintaining some OS X 10.10 machines which require cron for various tasks (watchdog processes, /tmp cleaners, etc.). One of them has mysteriously stopped its cron daemon, and I can't seem to bring it back up short of manually running the /usr/sbin/cron
command as root.
This isn't really maintainable; we distrust the stability of these machines enough that we have scheduled some staggered reboots in the crontab, so someone would have to ssh
in and restart cron every time it reboots.
I have tried unloading and reloading the cron plist for launchd:
launchctl unload /System/Library/LaunchDaemons/com.vix.cron.plist
launchctl load /System/Library/LaunchDaemons/com.vix.cron.plist
I thought that would start it, but it did not. I then tried:
launchctl start /System/Library/LaunchDaemons/com.vix.cron.plist
But that also had no effect. There is still no cron
in the process list, cron jobs aren't running, and launchctl list
says - 0 com.vix.cron
.
Moving away from cron to pure launchd is one way to get around this but it would require diverging our linux and mac code even further, and would require a lot of testing and frankly a lot more familiarity with launchd.
Being relatively new to OSX I have no idea where to go from here. How can I get cron to run on OSX 10.10, and to start on boot?
Update:
/etc/crontab
exists as an empty file, but all users have their respective crontabs in /usr/lib/cron/tabs
.
A grep for cron in /var/log/system.log
turns up no results other than the sudo cat
invoked on the crontab files.
If I run this command once again:
launchctl load -w /System/Library/LaunchDaemons/com.vix.cron.plist
I get the error Operation already in progress
.