who or w command produces no tty information about terminal

Bug #1747198 reported by Terrance on 2018-02-03
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-terminal (Ubuntu)
Undecided
Unassigned

Bug Description

~$ lsb_release -rd
Description: Ubuntu 16.04.3 LTS
Release: 16.04

~$ apt-cache policy gnome-terminal
gnome-terminal:
  Installed: 3.18.3-1ubuntu1
  Candidate: 3.18.3-1ubuntu1
  Version table:
 *** 3.18.3-1ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        100 /var/lib/dpkg/status

When running the `who` or `w` commands in a gnome-terminal window, it is not shown. Nor can you send a write username [tty] command to the gnome-terminal that is open.

From the gnome-terminal:

~$ w
 14:41:59 up 6:01, 3 users, load average: 0.19, 0.25, 0.18
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
terrance tty7 :0 08:40 6:01m 25:07 0.08s /sbin/upstart -
terrance pts/1 :0.0 11:00 2:58m 0.47s 0.47s bash
terrance pts/6 :0.0 11:02 1:58 0.46s 0.46s bash
~$ tty
/dev/pts/7
~$ write terrance /dev/pts/7
write: terrance is not logged in on pts/7

From a xfce4-terminal window:

~$ w
 14:52:27 up 6:12, 3 users, load average: 0.34, 0.28, 0.21
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
terrance tty7 :0 08:40 6:11m 25:23 0.08s /sbin/upstart -
terrance pts/1 :0.0 11:00 3:09m 0.47s 0.47s bash
terrance pts/6 :0.0 11:02 1.00s 0.48s 0.01s w
~$ tty
/dev/pts/6
~$ write terrance /dev/pts/6

Message from terrance@terrance-ubuntu on pts/6 at 14:53 ...
EOF

This seems to be only showing problems in the gnome-terminal. Any other terminal I have tried has worked successfully.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: gnome-terminal 3.18.3-1ubuntu1
ProcVersionSignature: Ubuntu 4.13.0-32.35~16.04.1-generic 4.13.13
Uname: Linux 4.13.0-32-generic x86_64
NonfreeKernelModules: nvidia_uvm nvidia_drm nvidia_modeset nvidia
ApportVersion: 2.20.1-0ubuntu2.15
Architecture: amd64
CurrentDesktop: XFCE
Date: Sat Feb 3 14:48:05 2018
ProcEnviron:
 LANGUAGE=en_US
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: gnome-terminal
UpgradeStatus: No upgrade log present (probably fresh install)

Terrance (kato223) wrote :
Terrance (kato223) wrote :

One way around this is to run `ssh localhost` in the terminal window then it works.

Egmont Koblinger (egmont-gmail) wrote :

VTE no longer does utmp logging. This was an upstream change made almost three years ago at https://bugzilla.gnome.org/show_bug.cgi?id=747046, and is clearly not going to get reverted by upstream.

Actually, most other VTE-based emulators (e.g. xfce4-terminal) are also affected in newer Ubuntu releases, while a few VTE-based emulators (can't recall which ones, sorry) added back utmp logging of their own.

Some other terminal emulators, such as terminology and st (Ubuntu package: stterm) don't do utmp logging either.

Two possible command line solution are mentioned in comments 34 & 35 of the aforementioned link. They could be set up as "Custom command" in gnome-terminal, and are clearly more lightweight than ssh.

Ubuntu should ship such a command line tool if it thinks that utmp logging is important, which was argued against in the VTE bug.

Terrance (kato223) on 2018-02-04
description: updated
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.