"machinectl shell" connections immediately terminated
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Focal |
Fix Released
|
Medium
|
Unassigned |
Bug Description
[Impact]
This bug prevents users on Impish and newer from connecting to Focal systemd containers using `machinectl shell`. This limits users ability to manage containers spawned with systemd-nspawn.
[Test Plan]
On a Jammy host, do the following:
* Install systemd-container and debootstrap if necessary:
$ sudo apt install debootstrap systemd-container
* Create a Focal filesystem for the container:
$ sudo debootstrap --arch=<arch> focal /var/lib/
* Launch the container:
$ sudo systemd-nspawn -D /var/lib/
* Inside the container, set a password for root and then exit:
$ passwd # Enter password when prompted
$ exit
* Re-launch the container with -b option:
$ sudo systemd-nspawn -D /var/lib/
* In a separate terminal window, try to connect to the container:
$ sudo machinectl shell test-container
* Observe the "Connection to machine test-container terminated" error message.
[Where problems could occur]
The patch changes a path_equal() call to path_equal_ptr() which NULL-checks before calling path_compare(). This avoids an assertion failure in path_compare() and allows the term to be correctly configured in execution environments requiring one. If were regressions were to occur, it would be related to this configuration.
[Other Info]
This bug occurs when trying to connect to a Focal container from e.g. a Jammy host. For SRU verification, the container
should be Focal, and the host should be Jammy. The -proposed package should be installed in the Focal container.
[Original Description]
The command "machinectl shell" does not work in systemd 249.9-0ubuntu2:
$ sudo machinectl shell ns-xxx
Connected to machine ns-xxx. Press ^] three times within 1s to exit session.
Connection to machine ns-xxx terminated.
The issue seems to be described here:
https:/
https:/
and solved here:
https:/
Related branches
- Lukas Märdian: Approve
-
Diff: 170 lines (+142/-0)4 files modifieddebian/changelog (+11/-0)
debian/patches/lp1959475-core-make-sure-we-don-t-get-confused-when-setting-TERM-fo.patch (+34/-0)
debian/patches/lp1966800-shared-calendarspec-when-mktime-moves-us-backwards-jump-f.patch (+95/-0)
debian/patches/series (+2/-0)
tags: | added: rls-ff-incoming rls-jj-incoming |
tags: | added: focal |
tags: | added: fr-2315 |
Changed in systemd (Ubuntu Focal): | |
importance: | Undecided → Medium |
Changed in systemd (Ubuntu): | |
importance: | Undecided → Medium |
tags: | removed: rls-ff-incoming rls-jj-incoming |
description: | updated |
tags: | added: foundations-todo |
description: | updated |
tags: | removed: foundations-todo |
Sorry, the patch in:
https:/ /github. com/systemd/ systemd/ commit/ e8cf09b2a2ad0d4 8e5493050d54251 d5f512d9b6
is already applied in systemd 249.9-0ubuntu2, so that is not the solution.