No sign of updates still being installed when shutting down

Bug #677516 reported by Sergey "Shnatsel" Davidoff
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
One Hundred Papercuts
Invalid
Low
Unassigned
unattended-upgrades (Ubuntu)
Invalid
High
Unassigned

Bug Description

On machines which have Internet access not very often and with unattended-upgrades enabled sometimes unattended-upgrades doesn't finish working before user shuts down their computer. It causes the system to show Ubuntu splash screen for quite a while instead of shutting down. Users migrating from ms windows usually think that the system froze up and switch off the computer with power button, causing dpkg to refuse installing any more packages or even messing up certain apps or (in extreme cases) even breaking the filesystem.

Plymouth shoud show a message like "finishing installing software updates, please wait" on shutdown when unattended-upgrades is still running.

Related branches

Revision history for this message
Chris Wilson (notgary-deactivatedaccount) wrote :

While this bug could be considered a feature request, the addition of a text message on a particular screen seems like a trivial fix and so I am confirming this as a papercut.

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

I'm pretty sure there is already another bug for this..

Changed in update-manager (Ubuntu):
importance: Undecided → Low
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

That's how I make Plymouth display messages: http://dl.dropbox.com/u/5279564/plymout-in-x11.png

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

It turned out to be not a feature request, but a bug. It's already implemented in the script responsible for that, but it doesn't work. It just doesn't show anything. I accidentially made it show " sign, but I don't remember how I did it. I'll investigate this further.

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

Well, if I run both plymouthd and the message command as root, it works. I tried setting suid on that script but it didn't help. I hope if we chown it to the user who runs plymouthd it will work.

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

Tried chowning to daemon, it didn't help.

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

Yes, I managed to make it show messages! It works for me when /usr/share/unattended-upgrades/unattended-upgrade-shutdown is set to: owner - daemon, group - root. I guess the group doesn't matter.

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

It's a bug in /usr/share/unattended-upgrades/unattended-upgrade-shutdown script, which comes from unattended-upgrades package. It's a bug, not a feature request, because this message is implemented but doesn't work (I managed to fix it, though).

affects: update-manager (Ubuntu) → unattended-upgrades (Ubuntu)
Changed in hundredpapercuts:
status: Confirmed → In Progress
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

Chowning to daemon and setting suid fixes it indeed. But there's another problem: we face a race condition between unattended-upgrades and plymouth. My way to workaround this is to create a separate process which tries to show the message several times with some interval (I did so in my greeter script and it works), but I don't know how to implement this in Python.

Revision history for this message
Vish (vish) wrote :

Could you attach the branch with the fix and submit if for review?

Changed in hundredpapercuts:
importance: Undecided → Low
milestone: none → nt7-potpourri
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

I've linked and proposed for merging a branch with the fix, but nobody seems to notice it. What am I doing wrong?

Revision history for this message
Vish (vish) wrote :

It's not you.. its vacation time for most of the folks doing sponsoring/code review.. ;-)

Revision history for this message
Chris Wilson (notgary-deactivatedaccount) wrote : Re: [Bug 677516] Re: No sign of updates still being installed when shutting down

Yeah dude, don't worry about it. People will take notice soon enough over
the next week or two.

On 31 Dec 2010 13:51, "Vish" <email address hidden> wrote:

It's not you.. its vacation time for most of the folks doing
sponsoring/code review.. ;-)

--
You received this bug notification because you are subscribed to One
Hundred Paper Cuts.
https:...

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport and your patch. I just tested the problem on my box with the following test (on the console):
$ sudo -s
# python -c 'import apt_pkg, gtk; apt_pkg.get_lock("/var/run/unattended-upgrades.lock"); gtk.main()' &
(this is to get the lock and keep it)
# /usr/share/unattended-upgrades/unattended-upgrade-shutdown &
(this keeps printing:
 WARNING - Unattended-upgrade in progress during shutdown, sleeping for 5s
)
# plymouth --show-splash

For me this shows the splash and the expected text that it waits. Doing a shutdown (while
# python -c 'import apt_pkg, gtk; apt_pkg.get_lock("/var/run/unattended-upgrades.lock"); gtk.main()'
is running) has the same effect, splash shows the text.

Please let me know what kind of behavior you see and what you did to reproduce the problem so that we get
a better understanding of this bug.

Changed in unattended-upgrades (Ubuntu):
status: New → Incomplete
importance: Low → High
Revision history for this message
Michael Vogt (mvo) wrote :

I increase the importance because is important that users know whats going on if the machine is waiting for the upgrade to finish.

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

I switched it back to root:root without suid and it works for me now. I added the following line to /bin/plymouth-greeter:
subprocess.call(["/bin/plymouth","message", "--text", "unattended-upgrades were here"])
It used to work for me in X11 Plymouth renderer if I started Plymouth daemon as root and passed messages to it, also as root, but it didn't work on shutdown. I chowned it to daemon and added suid bit, and the messages appeared on shutdown too. I switched permissions back and it still works... I'm totally confused with all those Upstart and Plymouth permissions now.

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks Sergey! If you did see no message then there is certainly a bug somewhere, what is odd about
it is that the script should have the persmissions you gave it to it already. It would be great if you could
poke it some more to see if you can reproduce the problem again.

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

Well, my /usr/share/unattended-upgrades script looks like this now:
...
    # run
    start_time = time.time()
    while True:
 subprocess.call(["/bin/plymouth","message", "--text", "unattended-upgrades were here"])
...

I don't see the message every time I shut down the machine, but it's likely because this line is executed before Plymouth is up. I'll use the lock file test you provided and try again.

I started testing this because I saw similar problem on a machine connected to the internet via proxy which silently refused most connections, including Ubuntu repositories. The machine just kept showing the splash and didn't shut down for a long time. But the lock file should be present in this case, so I blamed Plymouth.

I wonder why non-SUID script didn't work for me in the beginning. I tested in on this and on my plymouth-greeter script, both of them didn't work without SUID.

Changed in hundredpapercuts:
status: In Progress → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for unattended-upgrades (Ubuntu) because there has been no activity for 60 days.]

Changed in unattended-upgrades (Ubuntu):
status: Incomplete → Expired
Changed in unattended-upgrades (Ubuntu):
status: Expired → New
Changed in hundredpapercuts:
status: Incomplete → New
Changed in hundredpapercuts:
milestone: nt7-potpourri → quantal-11-misc
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

I cannot reproduce this anymore; invalidating.

Changed in hundredpapercuts:
status: New → Invalid
Changed in unattended-upgrades (Ubuntu):
status: New → Invalid
Changed in hundredpapercuts:
milestone: quantal-11-misc → none
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.