update manager does not check for updates after suspend

Bug #249220 reported by Christian Apolloni on 2008-07-16
260
Affects Status Importance Assigned to Milestone
anacron (Ubuntu)
Undecided
Michael Vogt
Hardy
Medium
Michael Vogt
Intrepid
Undecided
Michael Vogt

Bug Description

Binary package hint: update-manager

I am using Hardy Heron. It seems updates are not checked in some situations when you suspend.

TEST CASE:
1. install hardy on a laptop
2. remove /var/lib/apt/lists/* and /var/lib/apt/periodic/* and /var/spool/anacron/cron.daily (to force the apt cron job to run)
3. run "sudo touch /var/lib/update-notifier/dpkg-run-stamp" to force the applet to re-read the status
4. suspend the machine and resume the machine
5. verify that nothing happens (no update for the apt notification) - this can take up to 30min

6. install the version of anacron from hardy-proposed
7. repeat steps 2-4
8. verify that after some time (up to 30min) the notification buble show up that updates are available

I use suspend every night and resume every evening after I come back from work. Update manager did never check for updates. I found out since I expected some security updates which never come, then I started update manager and it showed that package information was 27 days old. I checked manually and found a lot of updates...

Under software sources I have the following options selected:

Important security updates (hardy-security)
Recommended updates (hardy-updates)
Check for updates: Daily
Only notify about available updates
Show new distribution releases: Normal releases

I am fairly sure updates were working when I was simply rebooting (there were problems with suspend at that time). I guess update manager checks for updates at every boot. Maybe it has to check after every resume from suspend too?

Flagging as security vulnerability since important security updates can be missed (like it happened to me...).

There is another report here: http://brainstorm.ubuntu.com/idea/10305/

I just found this anacron bug in dapper which maybe is related: https://bugs.launchpad.net/ubuntu/dapper/+source/update-manager/+bug/36816

But the proposed solution is present in my system (the anacron scripts). After resume ps shows anacron running, so maybe this is not a duplicate.

Thank you for filing this bug and helping make Ubuntu better. I'm in the process of reliably reproducing it. If I succeed I will set the status of this bug to 'confirmed'. Please keep us updated of anything you find in the meantime.

I refrain from setting this as duplicate of bug 36816 as that bug is closed.

If possible would you please check if the attached script (03anacron) resolves the issue? It should be put as an executable in /usr/lib/pm-utils/sleep.d/ Please do not hesitate to ask if putting the script in the right place and/or making it executable is not straightforward for you.

From your description I'm not sure whether you already forced your system to perform the update itself. If so, it might take a while before new updates are available so you can check that the script is working. By enabling 'pre-released updates' temporarily in software sources, you can convince the system that there are updates waiting.

After that, please see if the update notification appears next time you resume from suspend. Note that it takes 5 minutes for anacron to start after resume if the default /etc/anacrontab is being used. After that the daily apt job can take up to 30 minutes to start. This means it can take up to 35 minutes before you are being notified.

Be sure not to perform the update itself, if you do not want the pre-released packages on your system. Disable it again in the software sources and run 'sudo apt-get update' in a terminal to get back to your initial configuration.

Thanks.

Setting status to incomplete to indicate information was being asked for (the result of using attachment 03anacron). If the attachment works, this issue could be fixed in the anacron package.

Changed in update-manager:
status: New → Incomplete
Michael Vogt (mvo) wrote :

@mouz: thanks a lot for your patch. I integrated it into a debdiff (with some slight changes).

Michael Vogt (mvo) wrote :
Changed in anacron:
assignee: nobody → mvo
status: Incomplete → In Progress
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package anacron - 2.3-13.1ubuntu3

---------------
anacron (2.3-13.1ubuntu3) intrepid; urgency=low

  * debian/pm-utils.{power,sleep}.d:
    - install pm-utils hook that starts/stops anacron on
      suspend/resume (LP: #249220)

 -- Michael Vogt <email address hidden> Mon, 28 Jul 2008 13:44:52 +0200

Changed in anacron:
status: In Progress → Fix Released
Michael Vogt (mvo) wrote :

I uploaded a fix into my PPA at:

deb http://ppa.launchpad.net/mvo/ubuntu hardy main

please test and give feedback (based on the excellent test instructions by mouz )

@Michael: anacron package in PPA does not fix this

I upgraded anacron from your PPA. This version of the anacron is not started on resume after suspend. In /var/log/pm-suspend.log:

===== Mon Jul 28 16:32:03 CEST 2008: running hook: /usr/lib/pm-utils/sleep.d/95anacron =====
/usr/lib/pm-utils/functions: 93: Syntax error: "(" unexpected (expecting "fi")

When using /bin/bash instead of /bin/sh in 95anacron, the message does not show up and anacron is started on resume (verified using 'grep cron /var/log/syslog').

I re-checked the update-notification is triggered this way (after correcting for /bin/sh).

Michael Vogt (mvo) wrote :

@mouz: thanks a lot for testing the updated package! I uploaded a new version into my PPA, could you give that one a try? I should give the error.

Thanks,
 Michael

@michael: yes, great. Now apticron starts on resume and apt gets a chance to check for updates. Thanks.

Michael Vogt (mvo) on 2008-07-31
Changed in anacron:
assignee: nobody → mvo
importance: Undecided → Medium
status: New → In Progress
Michael Vogt (mvo) on 2008-07-31
description: updated
Martin Pitt (pitti) wrote :

Accepted into -proposed, please test and give feedback here. Please see https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in anacron:
status: In Progress → Fix Committed
x (xk2c-deactivatedaccount) wrote :

i am following this bugreport.

Just a hint @michael:
anacron in intrepid needs an other upload to fix the:

$ ./95anacron
/usr/lib/pm-utils/functions: 92: Syntax error: "(" unexpected (expecting "fi")

there too.

I have created a debdiff. HTH

The fix in -proposed fixes the bug on my system.

Martin Pitt (pitti) wrote :

Reopening for the syntax error, thanks Thilo!

Changed in anacron:
status: Fix Released → In Progress
Michael Vogt (mvo) on 2008-08-04
Changed in anacron:
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package anacron - 2.3-13.1ubuntu4

---------------
anacron (2.3-13.1ubuntu4) intrepid; urgency=low

  * debian/pm-utils.{power,sleep}.d:
    - fix Syntax error (LP: #249220)
      patch from Michael Vogt thx

 -- Thilo Six <email address hidden> Fri, 01 Aug 2008 17:34:06 +0200

Changed in anacron:
status: Fix Committed → Fix Released
x (xk2c-deactivatedaccount) wrote :

Thanks Michael for that pleasure. ;)

Martin Pitt (pitti) wrote :

Copied to hardy-updates.

Changed in anacron:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public Security information  Edit
Everyone can see this security related information.

Other bug subscribers

Bug attachments