Ubuntu – the proper setup for “anacron”? (Ubuntu 9.10, 10.04)

croninit.dlog-filesUbuntu

I am running Ubuntu 9.10 and 10.04 on MediaTemple (ve) servers.

On both of them, the anacron setup is broken, … and they have been broken since I first installed Ubuntu. It has only come to my attention recently, when I realize my log files were not rotating.

I am hoping someone who has anacron working can help diagnose the problem and suggest a fix.

Here is /etc/cron.d/anacron
This part works correctly: Every morning at 7:30am, cron executes this command to start up anacron.

# /etc/cron.d/anacron: crontab entries for the anacron package

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

30 7    * * *   root    test -x /etc/init.d/anacron && /etc/init.d/anacron start >/dev/null

The problem is that /etc/init.d/anacron start fails:

# /etc/init.d/anacron start >/dev/null
start: Unknown job: anacron

Notice that /etc/init.d/anacron is a symbolic link to /lib/init/upstart-job:

# ls -l /etc/init.d/anacron
lrwxrwxrwx 1 root root 21 Jan 12  2010 /etc/init.d/anacron -> /lib/init/upstart-job

Now I am stumped. Anyone have any suggestions how to fix this?

Take a look in /var/log and see if your log files are being rotated (as opposed to growing indefinitely). If they are being rotated, then you probably have a working anacron, so please check your setup and let me know how it differs from mine.

Thanks in advance, …

Best Answer

Upstart actually uses config files in /etc/init for each service, not /etc/init.d. I assume the /etc/init.d links are there to preserve compatibility with sysvinit. Here's the upstart getting started guide which explains this.

I don't have an ubuntu system so I can't check the contents of /etc/init/anacron.conf, but I suspect from gooling it might just be exec anacron -s. Check in /etc/init.removed/ and see if there is an anacron.conf there that was removed by some upgrade process. You might be able to reinstall anacron to fix this as well.

Related Topic