systemctl set-default breaks recovery mode

Bug #1821252 reported by Steven Clarkson
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
friendly-recovery (Ubuntu)
Fix Released
High
Ioanna Alifieraki
Xenial
Fix Released
High
Ioanna Alifieraki
Bionic
Fix Released
High
Ioanna Alifieraki
Cosmic
Fix Released
High
Ioanna Alifieraki
Disco
Fix Released
High
Ioanna Alifieraki
Eoan
Fix Released
High
Ioanna Alifieraki

Bug Description

[Impact]

 * A recovery mode boot is effectively a normal boot on any system that has ever had systemctl set-default run on it, i.e., the recovery kernel parameter does nothing. In particular, ubiquity calls systemctl set-default as part of the oem-config process, rendering recovery mode useless on any oem-configured machine.

 * This is a regression from previous behavior, where recovery mode would override a user-set default target.

 * This would also restore the intuitive behavior of this package. It is intended to be run by setting a kernel parameter for a one-time boot, and should therefore take priority over any other settings (such as configuring a different default target).

[Test Case]

 * Run systemctl set-default multi-user.target

 * Use the GRUB menu to try to boot into recovery mode

 * Observe that you end up at a TTY, not in recovery mode

[Regression Potential]

 * Possible regression if someone set recovery as a default kernel parameter, then relied on the default systemd target to override it. This seems like an unlikely use-case.

[Original Description]

Fresh Ubuntu 18.04.2 server install

Try to boot to recovery mode from GRUB. Works correctly.

Use systemctl to set a different default, say systemctl set-default multi-user.target

Try to boot to recovery mode from GRUB. End up at getty and not the recovery menu.

Delete /etc/systemd/system/default.target* and recovery mode works normally again.

I believe this can be fixed by changing normaldir to earlydir in the generator.

Related branches

Revision history for this message
Steven Clarkson (sclarkson) wrote :

Here's a patch with the above fix

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "friendly-recovery-earlydir.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Eric Desrochers (slashd) wrote :

Hi,

Thanks for opening this bug and proposing a patch.

You have mentioned:
"I believe this can be fixed by changing normaldir to earlydir in the generator."

Did you test it ? We need to make sure it fixes this particular issue but also make sure it doesn't break anything nor cause regression.

Feel free to provide as much details as possible to help a potential future sponsor to understand the situation and what has been done to come to conclusion that this is the appropriate fix.

Another thing that would be highly appreciated ... if you could please create the SRU template.
All the details can be found here:

https://wiki.ubuntu.com/StableReleaseUpdates (3.1. SRU Bug Template)

Revision history for this message
Steven Clarkson (sclarkson) wrote :

Slightly confused about the procedure here. This bug was introduced in Debian in 0.2.39 as a fix for LP #1766872. This is the current version in cosmic and disco, and the bug was backported into xenial and bionic. I guess this should be tagged as regression-update? But it should also be fixed in Debian, where it has been abandoned.

Filling out an SRU template below.

[Impact]

 * A recovery mode boot is effectively a normal boot on any system that has ever had systemctl set-default run on it, i.e., the recovery kernel parameter does nothing. In particular, ubiquity calls systemctl set-default as part of the oem-config process, rendering recovery mode useless on any oem-configured machine.

 * This is a regression from previous behavior, where recovery mode would override a user-set default target.

 * This would also restore the intuitive behavior of this package. It is intended to be run by setting a kernel parameter for a one-time boot, and should therefore take priority over any other settings (such as configuring a different default target).

[Test Case]

 * Run systemctl set-default multi-user.target

 * Use the GRUB menu to try to boot into recovery mode

 * Observe that you end up at a TTY, not in recovery mode

[Regression Potential]

 * Possible regression if someone set recovery as a default kernel parameter, then relied on the default systemd target to override it. This seems like an unlikely use-case.

Mathew Hodson (mhodson)
Changed in friendly-recovery (Ubuntu):
importance: Undecided → Medium
Changed in friendly-recovery (Ubuntu):
importance: Medium → High
tags: added: rls-ee-incoming
tags: added: regression-update rls-bb-incoming
Changed in friendly-recovery (Ubuntu Eoan):
status: New → Confirmed
Changed in friendly-recovery (Ubuntu Disco):
status: New → Confirmed
Changed in friendly-recovery (Ubuntu Cosmic):
status: New → Confirmed
Changed in friendly-recovery (Ubuntu Bionic):
status: New → Confirmed
Changed in friendly-recovery (Ubuntu Xenial):
status: New → Confirmed
tags: added: sts
Changed in friendly-recovery (Ubuntu Xenial):
assignee: nobody → Ioanna Alifieraki (joalif)
Changed in friendly-recovery (Ubuntu Bionic):
assignee: nobody → Ioanna Alifieraki (joalif)
Changed in friendly-recovery (Ubuntu Cosmic):
assignee: nobody → Ioanna Alifieraki (joalif)
Changed in friendly-recovery (Ubuntu Disco):
assignee: nobody → Ioanna Alifieraki (joalif)
Changed in friendly-recovery (Ubuntu Eoan):
assignee: nobody → Ioanna Alifieraki (joalif)
tags: removed: rls-bb-incoming rls-ee-incoming
Changed in friendly-recovery (Ubuntu Xenial):
status: Confirmed → In Progress
Changed in friendly-recovery (Ubuntu Bionic):
status: Confirmed → In Progress
Changed in friendly-recovery (Ubuntu Cosmic):
status: Confirmed → In Progress
Changed in friendly-recovery (Ubuntu Disco):
status: Confirmed → In Progress
Changed in friendly-recovery (Ubuntu Eoan):
status: Confirmed → In Progress
Changed in friendly-recovery (Ubuntu Cosmic):
importance: Undecided → High
Changed in friendly-recovery (Ubuntu Bionic):
importance: Undecided → High
Changed in friendly-recovery (Ubuntu Xenial):
importance: Undecided → High
Changed in friendly-recovery (Ubuntu Disco):
importance: Undecided → High
Eric Desrochers (slashd)
description: updated
Revision history for this message
Eric Desrochers (slashd) wrote :

xnox will upload to debian experimental and will sync to eoan.
I'll take care of the stable release once the above ^ is completed.

- Eric

tags: added: sts-sponsor-slashd
Revision history for this message
Ioanna Alifieraki (joalif) wrote :

Debdiff for Disco.

Revision history for this message
Ioanna Alifieraki (joalif) wrote :

Debdiff for Cosmic.

Revision history for this message
Ioanna Alifieraki (joalif) wrote :

Debdiff for Bionic.

Revision history for this message
Ioanna Alifieraki (joalif) wrote :

Debdiff for Xenial.

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

This bug was fixed in the package friendly-recovery - 0.2.41

---------------
friendly-recovery (0.2.41) experimental; urgency=medium

  [ Janitor ]
  * Trim trailing whitespace.
  * Use secure URI in Vcs control header.

  [ Steven Clarkson ]
  * Symlink default.taget to earlydir instead of normaldir to be able
    to access recovery mode even if default target has been set via
    systemctl set-default (LP: #1821252).

 -- Dimitri John Ledkov <email address hidden> Fri, 21 Jun 2019 13:29:33 +0100

Changed in friendly-recovery (Ubuntu Eoan):
status: In Progress → Fix Released
Revision history for this message
Eric Desrochers (slashd) wrote :

Sponsored in stable release for D/C/B/X.

Note: The fix is already merged into Debian and Eoan (Current devel release).

Thanks Steven for your patch contribution, and Ioanna for producing the debdiffs and all the SRU related work.

Regards,
Eric

tags: removed: sts-sponsor-slashd
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Steven, or anyone else affected,

Accepted friendly-recovery into disco-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/friendly-recovery/0.2.39ubuntu0.19.04.1 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 and change the tag from verification-needed-disco to verification-done-disco. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-disco. 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 friendly-recovery (Ubuntu Disco):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-disco
Changed in friendly-recovery (Ubuntu Cosmic):
status: In Progress → Fix Committed
tags: added: verification-needed-cosmic
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Steven, or anyone else affected,

Accepted friendly-recovery into cosmic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/friendly-recovery/0.2.39ubuntu0.18.10.1 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 and change the tag from verification-needed-cosmic to verification-done-cosmic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-cosmic. 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 friendly-recovery (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed-bionic
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Steven, or anyone else affected,

Accepted friendly-recovery into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/friendly-recovery/0.2.38ubuntu1.1 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 and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. 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 friendly-recovery (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed-xenial
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Steven, or anyone else affected,

Accepted friendly-recovery into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/friendly-recovery/0.2.31ubuntu2.1 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 and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. 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.

Revision history for this message
Steven Clarkson (sclarkson) wrote :

Tested friendly-recovery 0.2.38ubuntu1.1 on Bionic.

Ran systemctl set-default multi-user.target
Rebooted and selected recovery mode from GRUB
Got to the recovery menu, as expected.

apt-cache policy friendly-recovery

friendly-recovery:
  Installed: 0.2.38ubuntu1.1
  Candidate: 0.2.38ubuntu1.1
  Version table:
 *** 0.2.38ubuntu1.1 100
        100 /var/lib/dpkg/status
     0.2.38ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages
     0.2.38 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu bionic/main i386 Packages

tags: added: verification-done-bionic
removed: verification-needed-bionic
Revision history for this message
Steven Clarkson (sclarkson) wrote :

Tested friendly-recovery 0.2.31ubuntu2.1 on Xenial.

Same procedure as Bionic. Reached recovery menu even after running set-default.

apt-cache policy friendly-recovery

friendly-recovery:
  Installed: 0.2.31ubuntu2.1
  Candidate: 0.2.31ubuntu2.1
  Version table:
 *** 0.2.31ubuntu2.1 500
        500 http://us.archive.ubuntu.com/ubuntu xenial-proposed/main amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu xenial-proposed/main i386 Packages
        100 /var/lib/dpkg/status
     0.2.31ubuntu2 500
        500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages
     0.2.31 500
        500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu xenial/main i386 Packages

tags: added: verification-done-xenial
removed: verification-needed-xenial
Revision history for this message
Steven Clarkson (sclarkson) wrote :

Tested friendly-recovery 0.2.39ubuntu0.18.10.1 on Cosmic.

Same procedure as Bionic. Was able to reach recovery menu even after running set-default.

apt-cache policy friendly-recovery

friendly-recovery:
  Installed: 0.2.39ubuntu0.18.10.1
  Candidate: 0.2.39ubuntu0.18.10.1
  Version table:
 *** 0.2.39ubuntu0.18.10.1 500
        500 http://archive.ubuntu.com/ubuntu cosmic-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     0.2.39 500
        500 http://archive.ubuntu.com/ubuntu cosmic/main amd64 Packages

tags: added: verification-done-cosmic
removed: verification-needed-cosmic
tags: added: verification-done-disco
removed: verification-needed-disco
Revision history for this message
Steven Clarkson (sclarkson) wrote :

Tested friendly-recovery 0.2.39ubuntu0.19.04.1 on Disco.

Same procedure as Bionic. Was able to reach recovery menu even after running set-default.

apt-cache policy friendly-recovery

friendly-recovery:
  Installed: 0.2.39ubuntu0.19.04.1
  Candidate: 0.2.39ubuntu0.19.04.1
  Version table:
 *** 0.2.39ubuntu0.19.04.1 500
        500 http://us.archive.ubuntu.com/ubuntu disco-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     0.2.39 500
        500 http://us.archive.ubuntu.com/ubuntu disco/main amd64 Packages

tags: added: verification-done
removed: verification-needed
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for friendly-recovery has completed successfully and the package has now been 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.

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

This bug was fixed in the package friendly-recovery - 0.2.39ubuntu0.18.10.1

---------------
friendly-recovery (0.2.39ubuntu0.18.10.1) cosmic; urgency=medium

  [ Steven Clarkson ]
  * lib/systemd/system-generators/friendly-recovery:
    Symlink default.target to earlydir instead of normaldir to be
    able to access recovery mode even if default target has been set
    via systemctl set-default (LP: #1821252).

 -- Ioanna Alifieraki <email address hidden> Fri, 21 Jun 2019 17:26:49 +0100

Changed in friendly-recovery (Ubuntu Cosmic):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package friendly-recovery - 0.2.38ubuntu1.1

---------------
friendly-recovery (0.2.38ubuntu1.1) bionic; urgency=medium

  [ Steven Clarkson ]
  * lib/systemd/system-generators/friendly-recovery:
    Symlink default.target to earlydir instead of normaldir to be
    able to access recovery mode even if default target has been set
    via systemctl set-default (LP: #1821252).

 -- Ioanna Alifieraki <email address hidden> Fri, 21 Jun 2019 15:07:01 +0100

Changed in friendly-recovery (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package friendly-recovery - 0.2.39ubuntu0.19.04.1

---------------
friendly-recovery (0.2.39ubuntu0.19.04.1) disco; urgency=medium

  [ Steven Clarkson ]
  * lib/systemd/system-generators/friendly-recovery:
    Symlink default.target to earlydir instead of normaldir to be
    able to access recovery mode even if default target has been set
    via systemctl set-default (LP: #1821252).

 -- Ioanna Alifieraki <email address hidden> Fri, 21 Jun 2019 17:32:41 +0100

Changed in friendly-recovery (Ubuntu Disco):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package friendly-recovery - 0.2.31ubuntu2.1

---------------
friendly-recovery (0.2.31ubuntu2.1) xenial; urgency=medium

  [ Steven Clarkson ]
  * lib/systemd/system-generators/friendly-recovery:
    Symlink default.target to earlydir instead of normaldir to be
    able to access recovery mode even if default target has been set
    via systemctl set-default (LP: #1821252).

 -- Ioanna Alifieraki <email address hidden> Fri, 21 Jun 2019 16:35:01 +0100

Changed in friendly-recovery (Ubuntu Xenial):
status: Fix Committed → 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.