[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#600262: apt: random_sleep should not be executed if anacron has started the cron.daily script



Hi,

On Wed, Oct 20, 2010 at 3:33 PM, Goswin von Brederlow <goswin-v-b@web.de> wrote:
>> Please apply this patch to avoid 'random_sleep' if the script was started by anacron.
>
> But if the system stays up all night then the jobs are also started by
> anacron. This time at the problematic time though.

I don't know exactly how 'cron' and 'anacron' are supposed to handle
the cron scripts but I've just let my workstation running over night
to see the result.

I've received this email from Anacron:
| From: Anacron <root@FQDN>
| To: root@FQDN
| Subject: Anacron job 'cron.daily' on FQDN
| Date: Sat, 23 Oct 2010 07:37:57 +0300 (EEST)
|
| /etc/cron.daily/apt:
| Sat Oct 23 07:35:02 EEST 2010
| 14147
| Sat Oct 23 07:35:02 EEST 2010
(where 14147 was PID of anacron)

So, it is clear that the 'apt' script was not executed by Cron but by
Anacron. This is the expected behaviour when anacron is installed from
/etc/crontab:
| # m h dom mon dow user	command
| 25 6	* * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts
--report /etc/cron.daily )

To conclude, I don't think the patch I've proposed is causing the
execution at the "problematic" time which seems to be 6:25AM. The
script was executed clearly at 7:35. Also, desktop systems are not
supposed to be running over night but those few exceptions are not
many.

Thanks



Reply to: