Indicator should only turn red after the last package has been installed

Bug #548981 reported by Conscious User
162
This bug affects 31 people
Affects Status Importance Assigned to Milestone
One Hundred Papercuts
Fix Released
Low
Papercuts Ninjas
Session Menu
Fix Released
Low
Conor Curran
update notifier
New
Undecided
Unassigned
dpkg (Ubuntu)
Fix Released
Undecided
Unassigned
indicator-session (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: indicator-session

During an update where several packages are installed, the Session Indicator turns red *immediately after* a package that requires restart is installed. The change should be postponed to after the *last* package in the list has been installed, in order to be more coherent with what the update-manager does: it shows the "restart required" dialog only after all packages have been installed.

This can also avoid misleading the user into restarting in the middle of the update.

ProblemType: Bug
Architecture: i386
Date: Fri Mar 26 18:15:50 2010
DistroRelease: Ubuntu 10.04
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Alpha i386 (20100325)
Package: indicator-session 0.2.7-0ubuntu2
ProcEnviron:
 LANG=en_US.utf8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-17.26-generic 2.6.32.10+drm33.1
SourcePackage: indicator-session
Uname: Linux 2.6.32-17-generic i686

Revision history for this message
Conscious User (conscioususer) wrote :
description: updated
Revision history for this message
Conscious User (conscioususer) wrote :

Rephrasing the descriptor, as the original one was very vague.

Revision history for this message
Ted Gould (ted) wrote :

I'm reassinging this to dpkg. I'm not sure that's the right package, but I think it's the right place. In indicator-session we're just watching for /var/run/reboot-required -- but that's what all the other indicators of reboot needing required are looking too. So instead of fixing this in indicator-session we should encourage dpkg/apt to not set the file until thier entire operation is complete.

affects: indicator-session (Ubuntu) → dpkg (Ubuntu)
Revision history for this message
Colin Watson (cjwatson) wrote :

dpkg does not touch this file itself; I imagine it's done by a trigger or something, although I don't know. However, dpkg itself does not provide a trigger that's run at the very end of an apt operation, because it does not know when that end would be. apt has Post-Invoke hooks, but if you use those then things won't work right if you run dpkg by hand.

It's not obvious to me what the correct solution is here. I don't think a change in dpkg is likely to be involved though ...

Revision history for this message
Kazade (kazade) wrote :

Can't the indicator check for: (/var/run/reboot-required AND apt_is_not_running)?

Revision history for this message
Sense Egbert Hofstede (sense) wrote :

This is a valid papercut as it affects usability, is a small issue that I hope is not too hard to fix.

Isn't this an issue in indicator-session, rather than in dpkg, though?

Changed in hundredpapercuts:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Vish (vish) wrote :

We discussed this bug during the UDS , and Ted mentioned he would be looking into fixing this for Natty.

Blueprint : https://blueprints.edge.launchpad.net/ubuntu/+spec/other-dx-n-indicator-session

Its now fixed in dpkg. just needs fixing in indicator-session

Changed in indicator-session (Ubuntu):
importance: Undecided → Low
status: New → Triaged
Changed in dpkg (Ubuntu):
status: New → Fix Released
Changed in hundredpapercuts:
status: Confirmed → Triaged
Vish (vish)
Changed in hundredpapercuts:
assignee: nobody → Papercuts Ninja (papercuts-ninja)
milestone: none → nt3-ayatana
Revision history for this message
Mark Fraser (launchpad-mfraz) wrote :

This also happens in Kubuntu where the restart icon appears in the system tray before the update has finished and if you're doing a dist upgrade.

papukaija (papukaija)
tags: added: maverick
Revision history for this message
frizzle21 (frederik-nnaji) wrote : Re: [Bug 548981] Re: Indicator should only turn red after the last package has been installed

The following email helped me understand a bit where all this comes from:
https://lists.ubuntu.com/archives/ubuntu-devel-announce/2006-January/000052.html

i tried "sudo /usr/share/update-notifier/notify-reboot-required", which
created the file "/var/run/reboot-required".
The Session Menu Indicator icon turned red instantly.

Knowing this, it is obvious, every application with root privileges can use
this script to set the flag i.e. to create "/var/run/reboot-required".
And knowing this, it is logical to have another flag which tells us whether
an upgrade is currently in progress or not, since that would be the only
thing that would conflict with suggesting a reboot to complete the update
procedure to the user.

Revision history for this message
frizzle21 (frederik-nnaji) wrote :

i also noticed that update-notifier seems to be watching files such as REBOOT_FILE aka /var/run/reboot_required.
Watching single files may be efficient in linux, yet i would prefer listening on a message bus.
An asymptotic example:
watching an infinite number of single files would require infinite resources to keep up with all the queries to the file system.

listening to an infinite number of messages on a serial message bus does not require infinite resources (e.g. mem or cpu), since the number of messages would expand over time, not over resources.

i hope this can help somehow in designing a scalable solution here..

Revision history for this message
timex (timex) wrote :

Yep , but is important too , when the intallation finish, the sesion indicator turns red, but the "restart text" option should turn red too.
Cos when the sesion indicator turns red, the new users doesnt know why , but if the text restar turns red too, the ussers will know why.

Thanks.

Revision history for this message
mahfiaz (mahfiaz) wrote :

Maybe the /usr/share/update-notifier/notify-reboot-required could check the /var/lib/dpkg/lock, and keep the loop until it is clean.
Or maybe even whatever (applet?) watchs for /var/run/reboot_required should watch the dpkg lock as well and display the red only when reboot_required is present and dpkg/lock is not. So when you start a second upgrade or install, it would turn back to black.

Revision history for this message
frizzle21 (frederik-nnaji) wrote :

this bug is marked fixed in dpkg

On Sat, Dec 4, 2010 at 22:40, mahfiaz <email address hidden> wrote:

> Maybe the /usr/share/update-notifier/notify-reboot-required could check the
> /var/lib/dpkg/lock, and keep the loop until it is clean.
> Or maybe even whatever (applet?) watchs for /var/run/reboot_required should
> watch the dpkg lock as well and display the red only when reboot_required is
> present and dpkg/lock is not. So when you start a second upgrade or install,
> it would turn back to black.

sounds sane to me, but somebody obviously fixed dpkg's behaviour, right
Vish?
what was the fix then? i don't see it in Natty alpha yet.. how far along is
it and will it fix the premature indication by the session menu indicator?

Revision history for this message
Karl Lattimer (karl-qdh) wrote :

If dpkg's behaviour is fixed does the UI respond accordingly, I'm not running natty yet that's a january thing

Revision history for this message
Colin Watson (cjwatson) wrote :

To my knowledge, nobody changed dpkg, and as I said in comment 4 I don't believe any change in dpkg would be necessary or appropriate.

Revision history for this message
Vish (vish) wrote :

During the UDS session, <https://blueprints.launchpad.net/ubuntu/+spec/other-dx-n-indicator-session>
It was mentioned that the fix for the dpkg part landed and all that remains is to fix it in the indicator-session. I dont know the commit #. Folks present during the session are on vacation, we can probably clarify after the holidays..

Revision history for this message
frizzle21 (frederik-nnaji) wrote :

On Thu, Dec 23, 2010 at 12:38, Karl Lattimer <email address hidden> wrote:

> If dpkg's behaviour is fixed does the UI respond accordingly, I'm not
> running natty yet that's a january thing

i'm running natty, and it's not fixed here..

Revision history for this message
frizzle21 (frederik-nnaji) wrote :

On Thu, Dec 23, 2010 at 13:54, Vish <email address hidden> wrote:

> During the UDS session, <
> https://blueprints.launchpad.net/ubuntu/+spec/other-dx-n-indicator-session
> >
> It was mentioned that the fix for the dpkg part landed and all that remains
> is to fix it in the indicator-session. I dont know the commit #. Folks
> present during the session are on vacation, we can probably clarify after
> the holidays..

the reboot_required flag being set should not be the sole condition for the
Session Menu Indicator to turn red.

as long as an apt lock is engaged, the session menu should not signal any
such thing!
that should be the condition, and i don't think we need dpkg to figure that
out for us.

curious to hear what exactly was fixed in dpkg ..

Vish (vish)
Changed in hundredpapercuts:
assignee: Papercuts Ninja (papercuts-ninja) → nobody
assignee: nobody → Papercuts Ninja (papercuts-ninja)
Revision history for this message
Ted Gould (ted) wrote :

Copying my notes on this into the bug.

When dpkg runs it'll set the reboot-required when a package needs to reboot. And then when it completes running it'll touch:

/var/lib/update-notifier/dpkg-run-stamp

If the timestamp on this file is newer than reboot-required or it is touched, only then should the session icon color change to red.

Changed in indicator-session:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Conor Curran (cjcurran) wrote :

The new way within indicator-session of handling the restart flag is to use the apt dbus interface. By using this the restart UI notice *should* not be visible until after all updates are finished.
Therefore I will close this bug and mark it fixed released. Although there maybe more bugs concerned with how this interaction is handled this bug seems out of date and irrelevant.

Changed in indicator-session:
status: Triaged → Fix Released
assignee: nobody → Conor Curran (cjcurran)
milestone: none → 0.3.3
Changed in indicator-session (Ubuntu):
status: Triaged → Fix Released
Changed in hundredpapercuts:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.