scripts in /etc/cron.daily , cron.weekly, cron.monthly not executed on 8.04 LTS Hardy

Bug #620627 reported by Jörn Hees
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
anacron (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: anacron

In 8.04 anacron is started on bootup via init-scripts.
After executing the tasks which it finds need to be executed as the were not executed during shutdown it exits.
It is never invoked again.

In /etc/crontab you find lines like these:
56 4 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
0 1 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
50 1 25 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )

The A || B is shell syntax for execute B only if A failed.
In case anacron is installed text-x /usr/sbin/anacron succeeds, so the scripts in cron.daily, weekly and monthly are _not_ executed here.

This issue is fixed in 10.04, but I think it's a serious security problem as many users follow guides about auto updating your server by placing a script in these directories (including me).

The fix to this is easy: Use the idea of the anacron package's /etc/cron.d/anacron file from Ubuntu 10.04:
--------
# /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
--------

If this file was included in 8.04's anacron package the anacron daemon would be restarted daily and do all the work in /etc/cron.daily weekly and monthly.

Jörn Hees (joernhees)
visibility: private → public
security vulnerability: yes → no
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.