Public bug reported:
Merge request: https://code.launchpad.net/~chris-bainbridge/livecd-
rootfs/+git/livecd-rootfs/+merge/512450
Title: Ubuntu Desktop live session shutdown waits 90 seconds for
session-1.scope
Project: livecd-rootfs
Affected file:
live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/user/ubuntu-desktop-installer.service
Release tested: Ubuntu 26.10 amd64 beta ISO
GNOME session version: gnome-session-bin 51.0-0ubuntu1
Summary
=======
Shutting down the Ubuntu Desktop live session can leave
session-1.scope/stop running for 90 seconds, then time out. The delay is
caused by the live-session ubuntu-desktop-installer.service not stopping
the Snap-launched installer process during session teardown.
Reproduction
============
1. Boot the Ubuntu 26.10 amd64 live ISO with an empty virtual disk.
2. Let the live desktop and Ubuntu Desktop Installer session finish
starting; waiting about 100 seconds reliably reproduced the issue.
3. Request shutdown (QEMU ACPI power button reproduces it).
4. Observe systemd reporting Job session-1.scope/stop running and waiting
until the 90-second stop timeout expires.
The issue was reproduced in QEMU without running the installer. On real
hardware, the corresponding visible symptom is the session-1.scope stop
job remaining active for roughly 1 minute 30 seconds.
Actual behavior
===============
The GNOME session worker remains in session-1.scope while waiting for
graphical-session-pre.target to stop. The user manager continues to show
ubuntu-desktop-installer.service as stop running. After 90 seconds the
system manager times out the session scope.
Expected behavior
=================
The live installer and its Snap-launched processes should stop as the
graphical session shuts down, allowing session-1.scope and the system to
shut down promptly without a 90-second timeout.
Root cause
==========
The service is Type=oneshot and runs
/snap/bin/ubuntu-desktop-bootstrap --try-or-install. The launcher stays
active while the installer UI is open, so the oneshot service remains in
its start operation when logout begins. Its ExecStart process is in a
generated snap.ubuntu-desktop-bootstrap.*.scope, separate from the
installer service's cgroup. With the service still starting, systemd does
not run an ExecStop hook; the Snap scope remains active and blocks
graphical-session-pre.target from stopping. GNOME's session worker waits
for that target, which leads to the 90-second session-1.scope timeout.
There is a second shutdown issue in the same unit: ExecStopPost runs
gsettings and gnome-extensions enable while GNOME is already stopping.
Testing the Snap-scope stop alone removed the 90-second timeout but left
roughly 26 seconds of additional cleanup delay, with gnome-extensions
blocked during session teardown.
Proposed fix
============
In the livecd-rootfs service unit:
* Change Type=oneshot to Type=simple, so systemd treats the running
installer launcher as an active service and runs its stop hook.
* Add ExecStop to stop the generated Snap application scope:
/usr/bin/systemctl --user stop
'snap.ubuntu-desktop-bootstrap.ubuntu-desktop-bootstrap-*.scope'
* Skip ExecStopPost settings restoration when the launcher was terminated
by SIGTERM during shutdown (SERVICE_RESULT=exit-code and
EXIT_STATUS=143). Keep the existing restoration for normal exits.
This change belongs in livecd-rootfs because that project supplies the
systemd user unit used to launch the live installer. Casper does not
contain this service unit in the tested source tree; the Snap scope is
relevant to how the service must stop the installer, but the observed
shutdown defect is in the live-session unit integration.
Validation
==========
The issue was reproduced with the original unit. Instrumentation measured
session-1.scope in stop-sigterm for 90.12 seconds.
With the proposed service change in a repacked test ISO, the session scope
went from active at guest uptime 107.67 seconds to inactive at 107.89
seconds; no deactivating sample was observed between them. The
SERVICE_RESULT and EXIT_STATUS values on shutdown were also confirmed as
exit-code and 143. The settings-restoration condition skips that shutdown
case and retains the commands for a clean service exit.
** Affects: livecd-rootfs (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2169209
Title:
Ubuntu Desktop live session shutdown waits 90 seconds for
session-1.scope
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/2169209/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs