Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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, ...

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Now this is strange, because since Karmic the /etc/cron.d/anacron has looked like this:

# /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 && /usr/sbin/invoke-rc.d anacron start >/dev/null
30 7    * * *   root    start -q anacron || :

as the job was moved to upstart.

Reinstalling anacron should then do the job (back up your existing configuration first of course).

share|improve this answer
    
Thanks for the help. Reinstalling anacron didn't fix it, but editing /etc/cron.d/anacron directly did solve the problem. –  David Jones Jan 24 '11 at 17:26
2  
For the reinstallation solution to have worked properly, you'd have to use sudo apt-get purge instead of sudo apt-get remove to remove the configuration files as well. Not removing the config file will make the system use the existing config instead of setting up the default one as the reinstallation was meant to do. –  Oxwivi Feb 21 '11 at 8:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.