Do not propose to reboot on WSL

Bug #1958668 reported by Jean-Baptiste Lallement
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ubuntu-release-upgrader (Ubuntu)
Fix Released
Low
Edu Gómez Escandell
Jammy
Fix Released
Medium
Brian Murray

Bug Description

[Impact]

- On WSL, at the end of a do-release-upgrade, the upgrader proposes to reboot the machine. On WSL it is not possible to reboot due to the lack of systemd, thus this causes an error message to appear, and the reboot to not happen.

- The fix solves this by:
    1. Not atemptiong to reboot
    2. Asking the user to close the WSL instance
- Furthermore, if the Ubuntu WSL launcher is recent enough:
    3. ubuntu-release-upgrade will signal the Ubuntu WSL launcher to shutdown WSL right after closing

[Test Plan]

UBUNTU TEST

- Modify "/etc/update-manager/release-upgrades" to say "Prompt=normal"
- Enable the proposed pocket
- Update and upgrade via apt
- Run "sudo do-release-upgrade -d", and say yes to all prompts
- Update should complete without issues

WINDOWS TEST

- Download "Ubuntu 22.04 LTS" from Microsoft Store
- Open "Ubuntu 22.04 LTS"
- Modify "/etc/update-manager/release-upgrades" to say "Prompt=normal"
- Enable the proposed pocket
- Update and upgrade via apt
- Run "sudo do-release-upgrade -d", and say yes to all prompts
- Old behaviour: At the very end it displays an error message indicating it failed to reboot.

- New behaviour: At the very end:
    1. You'll be asked to close all other instances of Ubuntu WSL.

    2. File /run/launcher-command will be created with contents
                 "action: reboot"

    3. You'll be asked to close the current instance of Ubuntu WSL.

    4. If you have the store verion of Ubuntu WSL nothing else will happen.
       If you have the latest version from the repository, Ubuntu WSL will
       shutdown right after. You can validate it via:
          A. Not complying in step 1, and seeing the other instances shut down.
          B. Place some file in /tmp/ and see how it has been removed.

[Where problems could occur]

- Any change whatsoever in program behaviour on Ubuntu Desktop is undesired, especially if it prevents Ubuntu Desktop from rebooting.

- If the Ubuntu WSL instance that we upgarde from was started without the launcher (e.g via VS code, or with "wsl -d Ubuntu2204LTS"), the shutdown will not happen immediately, but rather be posponed until whichever comes first:
   - All instances are closed for around 10 seconds
   - A Ubuntu WSL instance started with the launcher is closed.
This could be a bit annoying for the user but it's not fatal.

[Other Info]

- A sufficiently new version of the launcher is needed for the forced shutdown to occur. It is currently only available with the Github version, but it'll be part of store versions from the next release onwards.

Related branches

Changed in update-manager (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Brian Murray (brian-murray) wrote :

How can the upgrader detect that it is running on WSL?

affects: update-manager (Ubuntu) → ubuntu-release-upgrader (Ubuntu)
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

You can check if /proc/sys/fs/binfmt_misc/WSLInterop exists and consider that you are running on WSL if so. Do you plan on doing the change on release-upgrader?

Changed in ubuntu-release-upgrader (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Eduard Gómez Escandell (edugomez)
Revision history for this message
Brian Murray (brian-murray) wrote :

I've uploaded this change for Kinetic.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-release-upgrader - 1:22.10.5

---------------
ubuntu-release-upgrader (1:22.10.5) kinetic; urgency=medium

  [ Edu Gómez Escandell ]
   * DistUpgrade: No longer attempt to reboot in WSL (LP: #1958668).

  [ Brian Murray ]
  * Run pre-build.sh: updating mirrors, demotions, and translations.

 -- Brian Murray <email address hidden> Wed, 06 Jul 2022 13:07:45 -0700

Changed in ubuntu-release-upgrader (Ubuntu):
status: In Progress → Fix Released
description: updated
description: updated
Changed in ubuntu-release-upgrader (Ubuntu Jammy):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Brian Murray (brian-murray)
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Jean-Baptiste, or anyone else affected,

Accepted ubuntu-release-upgrader into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-release-upgrader/1:22.04.12 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in ubuntu-release-upgrader (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (ubuntu-release-upgrader/1:22.04.12)

All autopkgtests for the newly accepted ubuntu-release-upgrader (1:22.04.12) for jammy have finished running.
The following regressions have been reported in tests triggered by the package:

ubuntu-release-upgrader/1:22.04.12 (ppc64el, s390x)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/jammy/update_excuses.html#ubuntu-release-upgrader

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

description: updated
description: updated
description: updated
Revision history for this message
Edu Gómez Escandell (edugomez) wrote (last edit ):

The test titled WINDOWS TEST has been performed with:

 * Windows 11
 * WSL2
 * Launchers: both options:
    - Store version "Ubuntu 20.04 LTS" Updated first to 22.04, then tested.
    - Development build from Github.
 * ubuntu-release-upgrader from jammy-proposed

and it works as expected.

description: updated
Revision history for this message
Edu Gómez Escandell (edugomez) wrote (last edit ):

The test titled UBUNTU TEST has been performed with:

* Ubuntu 22.04 jammy
* VirtualBox 6.1.36
* ubuntu-release-upgrader from jammy-proposed

and it works as expected.

tags: added: verification-done verification-done-jammy
removed: verification-needed verification-needed-jammy
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-release-upgrader - 1:22.04.12

---------------
ubuntu-release-upgrader (1:22.04.12) jammy; urgency=medium

  [ Brian Murray ]
  * Add support for upgrading from End of Life releases (Ubuntu 20.10 and
    Ubuntu 21.04) to Ubuntu 22.04. (LP: #1975533)
  * DistUpgrade: Do not attempt to reboot in WSL. (LP: #1958668)
  * DistUpgrade/deb2snap.json: gnome-3-34-1804 is no longer a seeded snap and
    should not be refreshed. (LP: #1981485)
  * Run pre-build.sh: updating mirrors, demotions, and translations.

  [ William 'jawn-smith' Wilson ]
  * tests/test_quirks.py: Remove declaration of unused variables

 -- Brian Murray <email address hidden> Tue, 19 Jul 2022 06:52:28 -0700

Changed in ubuntu-release-upgrader (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for ubuntu-release-upgrader has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.