Broken timedate handling for failed hook runs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
update-notifier (Ubuntu) |
Fix Released
|
Medium
|
Steve Langasek | ||
Precise |
Fix Released
|
Medium
|
Steve Langasek | ||
Quantal |
Fix Released
|
Medium
|
Steve Langasek |
Bug Description
[Test Case]
1. As root, run:
cat > /usr/share/
Url: http://
Sha256: b732d5a4f4b122e
Script: /bin/true
^D
2. Run 'sudo /usr/lib/
3. Confirm that the file /var/lib/
4. Run 'sudo date -d "now + 4 days" to set the clock in the future
5. Run 'sudo /usr/lib/
6. Confirm that /var/lib/
7. Install the update-
8. Repeat steps 4 and 5
9. Confirm that /var/lib/
10. run 'sudo service ntp stop; sudo ntpdate 0.ubuntu.
Hi,
After some recent updates in precise, I've started receiving cron emails such as:
Date: Tue, 17 Apr 2012 11:49:02 +0200 (CEST)
Subject: Anacron job 'cron.daily' on bee
/etc/cron.
flashplugin-
http://
11.2.202.
Installing from local file /tmp/tmppRl5Rq.gz
Flash Plugin installed.
Then the next day:
Date: Wed, 18 Apr 2012 11:25:36 +0200 (CEST)
Subject: Anacron job 'cron.daily' on bee
/etc/cron.
flashplugin-
http://
11.2.202.
Installing from local file /tmp/tmpTeTtwA.gz
Flash Plugin installed.
Then after a day of silence:
Date: Fri, 20 Apr 2012 07:38:09 +0200 (CEST)
Subject: Anacron job 'cron.daily' on bee
/etc/cron.
flashplugin-
http://
11.2.202.
Installing from local file /tmp/tmpZsCTV4.gz
Flash Plugin installed.
There were indeed some flashplugin updates that I applied in the last days, but notethat the first two emails are for the *same* version. My laptop was probably in sleep over one night which might explain the day of silence.
/usr/share/
So I don't see why this should have run on the 20th.
But while checking the code, I believe I've actually found a bug in the handling of failed updates:
def hook_aged_
"""Check if this hook has been failing consistently for >= 3 days"""
try:
d = timedelta(
if d.days >= 3:
except OSError:
except Exception:
return False
os.times()[4] seems a completely bogus value for checking age:
python -c 'from datetime import timedelta; import os; hook_date = os.stat(
-1
-1315376334.45
19523955.25
1334900289.7
(I used the successful stamp file rather than a failed stamp file, but it's the same problem.)
I believe you want:
python -c 'from datetime import datetime; import os; hook_date = datetime.
Cheers,
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: update-
ProcVersionSign
Uname: Linux 3.2.0-18-generic x86_64
ApportVersion: 2.0.1-0ubuntu5
Architecture: amd64
Date: Fri Apr 20 15:02:17 2012
PackageArchitec
ProcEnviron:
LANGUAGE=
TERM=xterm
PATH=(custom, user)
LANG=fr_FR.UTF-8
SHELL=/bin/zsh
SourcePackage: update-notifier
UpgradeStatus: Upgraded to precise on 2009-12-07 (864 days ago)
Related branches
- Dennis Kaarsemaker: Pending requested
- Diff: 0 lines
Changed in update-notifier (Ubuntu): | |
importance: | Undecided → Medium |
Changed in update-notifier (Ubuntu): | |
assignee: | nobody → Steve Langasek (vorlon) |
Changed in update-notifier (Ubuntu Precise): | |
importance: | Undecided → Medium |
assignee: | nobody → Steve Langasek (vorlon) |
status: | New → Triaged |
Changed in update-notifier (Ubuntu Quantal): | |
status: | New → Triaged |
Changed in update-notifier (Ubuntu Quantal): | |
status: | Triaged → Fix Committed |
The hook date check seem alright though, so I don't really know why it ran twice on the same flashplugin version.