cron.daily doesn't execute scheduled scripts

Bug #382315 reported by marco.pallotta
42
This bug affects 9 people
Affects Status Importance Assigned to Milestone
anacron (Debian)
Unknown
Unknown
anacron (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

In my system (Hardy) the cron.daily scripts (etc/cron.daily/*) seems not to be daily executed.

This is my /etc/crontab
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#

This is my /etc/anacrontab

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

# These replace cron's entries
1 5 cron.daily nice run-parts --report /etc/cron.daily
7 10 cron.weekly nice run-parts --report /etc/cron.weekly
@monthly 15 cron.monthly nice run-parts --report /etc/cron.monthly

In /var/log/syslog I correctly see
Apr 30 08:37:22 ramses anacron[6700]: Job `cron.daily' started
Apr 30 08:37:22 ramses anacron[7737]: Updated timestamp for job `cron.daily' to 2009-04-30

but nothing seems having been executed.

If I manually launch
run-parts --report /etc/cron.daily
the scripts are correctly executed.

Revision history for this message
marco.pallotta (marco-pallotta) wrote :

Some days ago I have started my PC and syslog sayd:

May 14 08:40:56 ramses anacron[6696]: Anacron 2.3 started on 2009-05-14
May 14 08:40:56 ramses anacron[6696]: Will run job `cron.daily' in 5 min.
...
...
May 14 08:45:56 ramses anacron[6696]: Job `cron.daily' started
May 14 08:45:56 ramses anacron[7302]: Updated timestamp for job `cron.daily' to 2009-05-14

but then it seems that no scripts, in /etc/cron.daily, were executed (I also made a script that do a simple touch of a file in a directory but nor this was executed). Moreover my anacrontab has a period of 1 day and my PC was off for about 3-4 days, so the jobs weren't executed for more than 1 day (that it seems the period after the which anacron starts the job) and they should have been run.
If I watched /var/spool/anacron/cron.daily file I could see the timestamp updated to 20090514 so anacron assumed that the jobs were executed but this wasn't.

Revision history for this message
marco.pallotta (marco-pallotta) wrote :

I suspect the problem is in anacron.

Revision history for this message
Nikolaus Rath (nikratio) wrote :

What happens when you run run-parts --report /etc/cron.daily?

Revision history for this message
marco.pallotta (marco-pallotta) wrote :

When I manually run
run-parts --report /etc/cron.daily

all scripts are executed ok.
As I already told I suspect there is a bug in anacron.

Nikolaus Rath (nikratio)
Changed in anacron (Ubuntu):
status: New → Confirmed
Revision history for this message
NeilEvanJensen (neilevanjensen) wrote :

I had found this same problem today in karmic 9.10 for cron.daily I got it to work by editing the /etc/cron.daily/apt script by putting the word exit at the beginning of the script and problem gone. You can check the functioning of the cron.daily running by executing sudo run-parts -v /etc/cron.daily

I also have noticed that the regular root users crontab has a bug I get E23 no alternate file and it won't let me add anything there.

Here is the page I referenced for my solution https://lists.ubuntu.com/archives/ubuntu-users/2009-February/175422.html

Revision history for this message
marco.pallotta (marco-pallotta) wrote :

The problem is still present on Lucid Beta2.

If I manually run
run-parts -v /etc/cron.daily
(letting apt unmodified) all the scripts are executed correctly.

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Could you adjust/fiddle with the stamp file then run "strace /usr/sbin/anacron" for me

Changed in anacron (Ubuntu):
status: Confirmed → Incomplete
importance: Undecided → Medium
Revision history for this message
marco.pallotta (marco-pallotta) wrote :

I have posted the output of the command "strace /usr/sbin/anacron"
Launching anacron by hand seems to run, correctly, all the scripts.

Revision history for this message
Matt Austin (mattaustin) wrote :

I am experiencing the same issue with a new Ubuntu 10.04LTS Server instance.

/var/log/syslog shows that cron.daily is being triggered:
Jun 4 04:57:01 zoidberg CRON[3861]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))
Jun 5 04:57:01 zoidberg CRON[12269]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))
Jun 6 04:57:01 zoidberg CRON[28089]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))
Jun 7 04:57:01 zoidberg CRON[20047]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))
Jun 8 04:57:01 zoidberg CRON[7968]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))
Jun 9 04:57:01 zoidberg CRON[23848]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))

and running run-parts manually, executes all cron.daily scripts correctly:

matt@zoidberg:~$ sudo run-parts -v /etc/cron.daily
run-parts: executing /etc/cron.daily/00logwatch
run-parts: executing /etc/cron.daily/apache2
run-parts: executing /etc/cron.daily/apticron
run-parts: executing /etc/cron.daily/logrotate
run-parts: executing /etc/cron.daily/ntp
run-parts: executing /etc/cron.daily/popularity-contest
run-parts: executing /etc/cron.daily/sysklogd

If it makes any difference, this is on a new Parallels Virtuozzo/OpenVZ virtual server from Media Temple.

Revision history for this message
Frank S. (fstolze) wrote :

Bug confirmed on Ubuntu 10.04.1 LTS x86_64.

Revision history for this message
Qianqian Fang (fangq) wrote :

This bug has been bothering me for almost a year. Please investigate. thanks
Ubuntu 10.04.1 LTS x86_64.

Revision history for this message
Qianqian Fang (fangq) wrote :

Removing sendmail and related packages made my cron.daily work again! I did try the approach in Comment #5 by adding exit in the apt cron script, but it did not work.

Revision history for this message
xteejx (xteejx) wrote :

Hi guys,
There have been a few version changes since the last reported release (Lucid). The version in the development release Natty is the same version in Maverick, so **if possible** would anyone with this problem be able to test it on there, since this problem may be configuration-specific? Thank you.

Revision history for this message
xteejx (xteejx) wrote :

I have sent the bug upstream to Debian, but they may ask to test the version in Testing or Experimental, which is the version we have in Maverick and Natty. You can track it and make comments at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=619648 Bug set to Triaged.

Changed in anacron (Ubuntu):
status: Incomplete → Triaged
Revision history for this message
Kadok0520 (kadok0520) wrote :

ubuntu 10.04.2
10.10
11.04

also have this problem

Revision history for this message
Bill Sumerlin (bill-3) wrote :

test -x /usr/sbin/anacron is returning a result code of 1 whether anacron is installed or not.

I am running ubuntu 10.04 in an Amazon EC2 instance from an Ubuntu AMI. anacron is NOT installed on this system, though test -x seems to think it is.

So cron.daily is never run...

So I have 2 choices... modify the system script wherever it is, or make a new entry in crontab for the various scripts installed in cron.daily.

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

Other bug subscribers

Bug attachments

Remote bug watches

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