apt's crontab.daily should check power source after the random wait

Bug #705269 reported by manuel
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: apt

The /etc/cron.daily/apt in check the power source at startup then sleep a random period but doesn't check it again after this wait which may be more 1/2 hour later.

Tags: patch
Revision history for this message
manuel (manuel-soto) wrote :
Revision history for this message
manuel (manuel-soto) wrote :

$ LANG=C apt-cache policy apt
apt:
  Installed: 0.7.25.3ubuntu9.3
  Candidate: 0.7.25.3ubuntu9.3
  Version table:
 *** 0.7.25.3ubuntu9.3 0
        500 http://archive.ubuntu.com/ubuntu/ lucid-updates/main Packages
        100 /var/lib/dpkg/status
     0.7.25.3ubuntu7 0
        500 http://archive.ubuntu.com/ubuntu/ lucid/main Packages

Revision history for this message
Phillip Susi (psusi) wrote :

What? It does not appear to do any sleeping and your patch does not appear actually change anything.

Changed in apt (Ubuntu):
status: New → Incomplete
Revision history for this message
manuel (manuel-soto) wrote :

This patch change a lot...

The actual behavior is

1 initialization
2 check power status
3 exit if powered by batteries
4 sleep up to 30 minutes
5 apply updates

The proposed behavior is

1 initialization
2 check power status
3 exit if powered by batteries
4 sleep up to 30 minutes
3' exit if powered by batteries
5 apply updates

If you unplug the power during the step 4, it is possible that the batteries are wasted at step 5. W/ this simple change the script double check power source after a potential long sleep

Revision history for this message
Phillip Susi (psusi) wrote :

Ahh, I missed the second call to check_power. I see now.

Changed in apt (Ubuntu):
importance: Undecided → Low
status: Incomplete → Triaged
tags: added: patch
summary: - crontab.daily's apt check power source the random before wait
+ apt's crontab.daily should check power source after the random wait
Revision history for this message
Julian Andres Klode (juliank) wrote :

Really, please send an unified diff.

Revision history for this message
manuel (manuel-soto) wrote :

$ dpkg-query -W apt
apt 0.8.3ubuntu7

Revision history for this message
Julian Andres Klode (juliank) wrote :

A fix has been committed to the debian-sid branch of APT.

------------------------------------------------------------
revno: 2118
revision-id: <email address hidden>
parent: <email address hidden>
fixes bug(s): https://launchpad.net/bugs/705269
committer: Julian Andres Klode <email address hidden>
branch nick: debian-sid
timestamp: Thu 2011-04-21 09:53:37 +0200
message:
  debian/apt.cron.daily: Check power after wait, patch by manuel-soto (LP: #705269)

Changed in apt (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 0.8.14.1ubuntu1

---------------
apt (0.8.14.1ubuntu1) oneiric; urgency=low

  [ Michael Vogt ]
  * merged from the debian-sid bzr branch

  [ Julian Andres Klode ]
  * apt-pkg/depcache.cc:
    - Really release action groups only once (Closes: #622744)
    - Make purge work again for config-files (LP: #244598) (Closes: #150831)
  * debian/apt.cron.daily:
    - Check power after wait, patch by manuel-soto (LP: #705269)
  * debian/control:
    - Move ${shlibs:Depends} to Pre-Depends, as we do not want APT
      unpacked if a library is too old and thus break upgrades
  * doc/apt-key.8.xml:
    - Document apt-key net-update (LP: #192810)

apt (0.8.14.1) unstable; urgency=low

  * apt-pkg/acquire-item.cc:
    - Only try to rename existing Release files (Closes: #622912)

apt (0.8.14) unstable; urgency=low

  [ Julian Andres Klode ]
  * apt-pkg/indexcopy.cc:
    - Use RealFileExists() instead of FileExists(), allows amongst other
      things a directory named Sources to exist on a CD-ROM (LP: #750694).
  * apt-pkg/acquire-item.cc:
    - Use Release files even if they cannot be verified (LP: #704595)
  * cmdline/apt-get.cc:
    - Do not install recommends for build-dep (Closes: #454479) (LP: #245273)
  * apt-pkg/deb/deblistparser.cc:
    - Handle no space before "[" in build-dependencies (LP: #72344)
  * apt-pkg/policy.cc:
    - Allow pinning by glob() expressions, and regular expressions
      surrounded by slashes (the "/" character) (LP: #399474)
      (Closes: #121132)
  * debian/control:
    - Set Standards-Version to 3.9.2

  [ Michael Vogt ]
  * mirror method:
    - do not crash if the mirror file fails to download
  * apt-pkg/aptconfiguration.cc:
    - fix comparing for a empty string
  * debian/apt.cron.daily:
    - run unattended-upgrades even if there was a error during
      the apt-get update (LP: #676295)

  [ David Kalnischkies ]
  * apt-pkg/pkgcache.cc:
    - use the native Architecture stored in the cache header instead of
      loading it from configuration as suggested by Julian Andres Klode
 -- Michael Vogt <email address hidden> Fri, 29 Apr 2011 17:55:20 +0200

Changed in apt (Ubuntu):
status: In Progress → Fix Released
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.