← Back to team overview

desktop-packages team mailing list archive

[Bug 842799] Re: Software installation doesn't block session exit

 

I just discussed this with Michael. I may have messed up the details,
but here's what I understand.

There are many different kinds of tasks for which you should be prompted
to wait before a logout goes ahead. This already happens when you have
an unsaved document in a well-behaved application (like GEdit or
LibreOffice). Other examples include burning a CD, syncing an audio
player, defragmenting a disk, or sculpting something with a 3D printer.

It shouldn't be Unity's job to detect all of these. It shouldn't be
Unity's job even to know about any of them in particular; that wouldn't
scale. That's why there's a gnome-session API for individual
applications to announce that now would not be a good time to log out
... not yet ... not yet ... okay, now's good.
http://live.gnome.org/SessionManagement/GnomeSession#A8._QueryEndSession

However, for package installation and removal, it's not so simple. As
you point out, Sebastian, Ubuntu Software Center may not be running any
more while an installation or removal completes. But beyond that,
aptdaemon is running on the system bus, not the session bus. This has
the advantage that you don't even need to be logged in *at all* for a
task to complete. But it has two disadvantages. First, if a Debconf
question occurs, there's no-one to answer it. And second, there is,
apparently, no system-level equivalent to the gnome-session API for
aptdaemon to inhibit shutdown -- so the machine just shuts down and
leaves us with this corrupt package state.

So unless a system-level shutdown inhibit API is implemented, there are two ways to prevent the corruption problem here.
(1) In the short term, inhibit logout when there are any tasks. Michael says update-notifier is an appropriate place to do this, so I'm moving this report there.
(2) In the long term, add a check to the shutdown script so that it waits until all tasks are completed. I'm skeptical about how good this would look (and what happens if a maintainer script hangs?), but we can consider that in more detail later.

** Package changed: aptdaemon (Ubuntu) => update-notifier (Ubuntu)

** Changed in: update-notifier (Ubuntu)
       Status: Won't Fix => New

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to software-center in Ubuntu.
https://bugs.launchpad.net/bugs/842799

Title:
  Software installation doesn't block session exit

Status in “software-center” package in Ubuntu:
  Confirmed
Status in “update-notifier” package in Ubuntu:
  New

Bug description:
  software-center trunk r2261, aptdaemon 0.43+bzr691, Ubuntu 11.10 beta
  1

  1. In USC, start installing something big and complicated, like Ardour.
  2. While it is installing, choose "Shut Down" and confirm it.

  What happens:
  2. The computer shuts down immediately.
  3. Ardour is not installed.
  4. After restarting, and trying to install it again, errors at the console:
  ------------
  2011-09-06 16:03:11,918 - softwarecenter.backend - ERROR - error in _on_trans_finished 'Error: Package operation failed
  The installation or removal of a software package failed.

  Setting up liblo7 (0.26~repack-7) ...
  Setting up libgnomecanvasmm-2.6-1c2a (2.26.0-1build1) ...
  dpkg: error processing libvamp-sdk2 (--configure):
   Package is in a very bad inconsistent state - you should
   reinstall it before attempting configuration.
  ------------

  What should happen:
  2. A dialog appears explaining that you can't log out until Ubuntu Software Center is finished.
  3. Once the installation finishes, the computer shuts down.

  <https://wiki.ubuntu.com/SoftwareCenter#installing>: "5. The Center
  should begin blocking session exit."

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/software-center/+bug/842799/+subscriptions


References