Report.get_logind_session fails to determine session on cgroup2 systems
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Apport |
Fix Released
|
Medium
|
Unassigned | ||
apport (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Ubuntu >= 22.04 uses only cgroup2 (Ubuntu 20.04 used both and Ubuntu 18.04 only cgroup version 1). Report.
get_logind_session searches for cgroup lines with "name=systemd:" and then extracts the session from "/session-". This worked in Ubuntu 16.04 but started failing in 18.04.
Content of /proc/self/cgroup when printed from a terminal inside a Ubuntu desktop session:
Ubuntu 16.04 (xenial)
-------
```
12:cpuset:/
11:perf_event:/
10:pids:
9:blkio:/
8:hugetlb:/
7:net_cls,
6:cpu,cpuacct:/
5:devices:
4:freezer:/
3:rdma:/
2:memory:/
1:name=
```
Ubuntu 18.04 (bionic)
-------
```
12:freezer:/
11:net_
10:memory:/
9:rdma:/
8:cpu,cpuacct:/
7:devices:
6:perf_event:/
5:cpuset:/
4:pids:
3:hugetlb:/
2:blkio:/
1:name=
0::/user.
```
Ubuntu 20.04 (focal)
-------
```
13:memory:
12:perf_event:/
11:misc:/
10:pids:
9:hugetlb:/
8:cpuset:/
7:blkio:/
6:devices:
5:cpu,cpuacct:/
4:freezer:/
3:rdma:/
2:net_cls,
1:name=
0::/user.
```
Ubuntu 22.04 (jammy)
-------
```
0::/user.
```
description: | updated |
Changed in apport: | |
milestone: | none → 2.28.0 |
Changed in apport (Ubuntu): | |
importance: | Undecided → Medium |
Changed in apport: | |
importance: | Undecided → Medium |
Changed in apport (Ubuntu): | |
status: | New → Triaged |
Changed in apport: | |
status: | Fix Committed → Fix Released |
Changed in apport (Ubuntu): | |
status: | Triaged → Fix Committed |
I checked the bug reports against apport between 2018 and now, but I found none complaining about this regression. If no one objects (and provides a way to determine the current session and the session of a process), I will remove that code.