From Fedora Project Wiki

Offline Updates using systemd and PackageKit

Summary

Make updating of system components more reliable by doing it in an minimal, controlled environment.

Owner

Current status

  • Targeted release: Fedora 18
  • Last updated: 2012-07-23
  • Percentage of completion: 100%

The necessary systemd and PackageKit infrastructure has landed in rawhide with systemd 183 and PackageKit 0.8.1. All the necessary plymouth and GNOME pieces have landed in rawhide with GNOME 3.5.4. The feature is testable now.

Detailed Description

By "offline" OS updates we mean package installations and updates that are run with the system booted into a special system update mode, in order to avoid problems related to conflicts of libraries and services that are currently running with those on disk.

Updates will be downloaded in the background, and the user will be informed about available updates only once they are actually ready to be installed.

Installing updates will still be the users choice - if system updates are available, we will offer 'Install Updates & Restart' in addition to a plain 'Power Off' in the menus.

The system update mode is implemented by booting into a special target. The target installs the downloaded updates and then reboots back into the regular default target. Safeguards are in place to ensure that we reboot back into the default target even if the update fails or the update process crashes. For more details, see http://freedesktop.org/wiki/Software/systemd/SystemUpdates. After logging in again, the user is notified that system updates have been installed (or that the update has failed).

Note that this feature does not prevent you from using yum and other commandline tools to install updates whenever you want to. We also differentiate updates of 'OS components' (which we want to do in this offline fashion) from application updates and installations, which should still be possible from the UI without restarting the system.

The differentiation between 'OS components' and applications is necessarily a heuristic, since Fedora only knows about packages. The initial heuristic is that a package is considered an application if it installs a desktop file that is shown in the menus. This is not perfect and can be refined when additional metadata becomes available.

Also note that this feature is about implementing offline updates for GNOME. Other spins are not affected, although they could choose to use the same systemd and PackageKit infrastructure, and provide a similar experience.

Benefit to Fedora

Replacing libraries and files while the OS is running can cause problems ranging from application crashes to inconsistent system states where processes are using different versions of a library at the same time. By installing system updates 'outside' the normal system operation, we avoid these problems.

Secondary benefits of the work done for this feature include that we are downloading all updates before we notify the user about available updates, and thus avoid unpleasant wait times.

Scope

  • Update systemd to version >= 183 (done)
  • Complete the PackageKit support for offline updates (done)
  • Update gnome-packagekit to support offline updates
  • Update gnome-settings-daemon to support offline updates (done)
  • Update gnome-session to offer a restart dialog (done)
  • Update gnome-shell to offer 'Install Updates & Restart' when updates are available (done)
  • Adjust plymouth to show useful information during the offline update (done)

How To Test

  1. Testcase: Available system updates
    1. Use repositories which have system updates available
    2. Verify that you are not notified about available updates before they have been downloaded
    3. The 'Software Updates' UI should not offer to directly install system updates
    4. The user status menu should have a 'Restart and install updates' item
  2. Testcase 2: Installing system updates
    1. In the situation of testcase 1, choose 'Restart and install updates'
    2. Verify that the system shuts down, then restarts in the system update mode
    3. Plymouth should show a spinner or progress bar and inform you that software updates are installed
    4. When this completes, the system should reboot again, bringing you to the login screen
    5. Log in
    6. Verify that the 'Restart and install updates' menuitem is gone
    7. Rebooting the system now will not enter the system update mode, but just reboot as usual
  3. Testcase: Update problem
    1. Same situation as testcase 1, but with a package set that will not successfully update (one way to achieve this would be to manually set up a repository with an inconsistent set of updates)
    2. Repeat the same steps as in testcase 2
    3. Verify that the system update fails, but you get rebooted again and end up at the login screen again
    4. Verify that you get notified about the failed update attempt
    5. Verify that the failed system update is not tried again if you reboot again
  4. Testcase: Commandline use
    1. Same situation as testcase 1
    2. Open a terminal and run yum update
    3. Verify that this works as before
  5. Testcase: Application updates
    1. Use repositories which have application updates available
    2. Open 'Software Updates'
    3. Verify that the available updates are listed, and that you can install them without rebooting
  6. Testcase: Non-privileged user
    1. Create a user account
    2. Set up PolicyKit policy so that this user is not allowed to install updates (TODO: details needed)
    3. Verify that available updates do not cause notifications or other disruptions for this user
  7. Testcase: Disabling automatic downloads
    1. Install an override for the setting that controls whether PackageKit downloads updates automatically (TODO: details needed)
    2. Verify that updates are not downloaded even if they are available

User Experience

The desired user experience for System updates is described in https://live.gnome.org/GnomeOS/Design/Whiteboards/SoftwareUpdates

Dependencies

None outside of systemd, packagekit and GNOME components

Contingency Plan

If offline updates don't work in time for F18, we can go back to installing all updates while the system is running.

Documentation

Release Notes

  • Fedora 18 introduces offline system updates, which means that updates of system components are installed in a special environment outside the normal system operation.

Comments and Discussion