10.04 LTS Server anacron misconfig

Bug #793832 reported by clancyhood
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
anacron (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: anacron

I run VPSs with Ubuntu 10.04 LTS and have done for some months, and logs do not rotate. It seems this is an issue with anacron not running since the config file is misplaced.

/etc/crontab looks like this:

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

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

# m h dom mon dow user command
22 * * * * root cd / && run-parts --report /etc/cron.hourly
37 0 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
8 2 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
0 2 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#

I ran /etc/cron.daily/sysklogd and my logs rotated. So I added:

echo "ok"

To the last line of /etc/cron.daily/sysklogd and ran it again, to check my changes.

Then, I ran (from /etc/crontab):

# test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )

and nothing happened. This is because it merely tests to see if anacron is executable; but it doesn't test that it is *running*.
Like a lot of people out there in internetland (one example: http://ubuntuforums.org/showthread.php?t=1468187 ), my anacron.conf is in /etc/init.removed and so anacron won't start if you ask it to. I mv'd the conf

# mv /etc/init.removed/anacron.conf /etc/init/

and started anacron, apparently for the first time. It just so happens that I have a fresh 10.04 install on a VPS (from earlier today) and anacron is misconfig'd there too:

# start anacron
start: Unknown job: anacron

Suggest that line in /etc/crontab should be :

root test -f /etc/init/anacron.conf || ( cd / && run-parts --report /etc/cron.daily )

OR distro come with anacron.conf in correct location OR both

Tags: lucid
tags: added: lucid
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in anacron (Ubuntu):
status: New → Confirmed
Revision history for this message
Gregg Berkholtz (TOCICI) (tocici) wrote :

On a stock 10.04 install, I can confirm that moving the file:
 /etc/init.removed/anacron.conf

into the folder:
 /etc/init/

Resolves this issue for me as well.

Revision history for this message
Jonas Larsson (jonlar) wrote :

I also moved anacron.conf, and that resolved my log-rotating issues.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.