tmux sessions don't show up with who, users, ...
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tmux (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Medium
|
Athos Ribeiro |
Bug Description
[Impact]
This is a regression that gets tmux not to record logins through utmp for its sessions (https:/
This SRU is especially important because it affects unattended-upgrades users. unattended-upgrades uses /usr/bin/users to determine logged-in users, which queries utmp for that purpose. If running tmux sessions are not registered, and unattended-upgrades is configured not to reboot when there are users logged in, then it will misbehave and forcefully kill the running (not recorded) tmux session.
The MP provided solves the issue by introducing the specific upstream fix into Focal's tmux.
[Test Plan]
* Reproducing:
* Install tmux-3.
* Start a tmux session (by running tmux) and detach from the session ("ctrl+b", then press "d").
* Run "who". You should verify that no entries for the running tmux session were recorded.
* Run "tmux attach" and exit the session.
* Verifying fix:
* Install tmux-3.
* Start a tmux session (by running tmux) and detach from the session ("ctrl+b", then press "d").
* Run "who". You should verify that there is an entry for the running tmux session recorded.
* Run "tmux attach" and exit the session.
[Where problems could occur]
This is a cherry-pick commit from upstream. 113 other code changes (that are not present in this MP) were applied upstream before the patch being proposed was introduced, meaning the code path may deviate from upstream's codepath during execution leading to unexpected behaviour, which could result in tmux terminating abruptly (e.g., segmetation fault) for possible not tested scenarios when starting a tmux session.
In special, there were a small change in an upstream struct (window_pane) is being used in the code introduced by this patch (additional data was added). However, the change does not seem to affect the cherry-picked change AFAICT.
[original message]
Hallo!
I have recently - I am pretty sure it is since the 20.04 upgrade (coming from 18.04) - experienced the problem that (detached) tmux sessions don't show up anymore in the output of commands such as `who -u` or `users`.
Since I have a cron job for shutting down hosts where no users are logged in, I am constantly kicking out people now who have running jobs in detached tmux sessions.
We would be very happy if this could be fixed.
Thanks!
Related branches
- Sergio Durigan Junior (community): Approve
- Canonical Server: Pending requested
-
Diff: 64 lines (+42/-0)3 files modifieddebian/changelog (+9/-0)
debian/patches/add-utempter-code.patch (+32/-0)
debian/patches/series (+1/-0)
description: | updated |
Changed in tmux (Ubuntu Focal): | |
assignee: | nobody → Athos Ribeiro (athos-ribeiro) |
Changed in tmux (Ubuntu Focal): | |
status: | Triaged → In Progress |
description: | updated |
Hello and thanks for this bug report. I am able to reproduce the issue, which interestingly is not present in Groovy. I installed tmux 3.1b-1 from Groovy on a Focal system and it *does* set the utmp entries, so something must have changed between tmux 3.0a-2 and 3.1b-1. I had a look at the Ubuntu (= Debian) changelog and at the upstream commit history. Focal tmux (3.0a-2) correctly detected the utempter library [1]:
checking utempter.h usability... yes add_record. .. -lutempter
checking utempter.h presence... yes
checking for utempter.h... yes
checking for library containing utempter_
so that's not the issue. I'm marking this as Triaged for Focal and Fix Released for Groovy, but in order to push this forward we must identify the root cause of the issue, then we'll be able to evaluate the possibility of a SRU.
Debian doesn't not ship tmux 3.0a-2 anymore, so I don't think it's worth filing a bug in Debian even if tmux is a sync.
[1] https:/ /launchpadlibra rian.net/ 458624914/ buildlog_ ubuntu- focal-amd64. tmux_3. 0a-2_BUILDING. txt.gz