I'm really struggling to find the correct behaviour here. What I know:
- man utmp shows:
char ut_line[UT_LINESIZE]; /* Device name of tty - "/dev/" */
- GDM 2.20 only put the tty into this field
- GDM git does:
/*
* Set ut_line to the device name associated with this display
* but remove the "/dev/" prefix. If no device, then use the
* $DISPLAY value.
*/
if (display_device != NULL
&& g_str_has_prefix (display_device, "/dev/")) {
strncpy (u->ut_line,
display_device + strlen ("/dev/"),
sizeof (u->ut_line));
} else if (x11_display_name != NULL) {
strncpy (u->ut_line,
x11_display_name,
sizeof (u->ut_line));
}
- 'w' (the version in procps anyway) does:
if (*u->ut_line == ':')
/* idle unknown for xdm logins */
printf(" ?xdm? ");
- xdm (1.1.11) doesn't set ut_line at all.
- AccountsService only stores ut_line and ut_tv (the timestamp) as a login
record.
- gnome-control-center checks the history via AccountsService and checks if
ut_line has the prefix ":" or "tty"
So while this clearly wasn't intended when utmp/wtmp was designed it
seems everyone is using ut_line with ttyN for text logins and :n for X
logins. That suggests we should revert the patch in LightDM.
I haven't been able to get GDM to work on my machine, can someone
confirm the output of w in a modern GDM?
--
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to lightdm in Ubuntu.
https://bugs.launchpad.net/bugs/1380364
Title:
lightdm writes XDISPLAY instead of tty device name to utmp record
Status in Light Display Manager:
Fix Released
Status in Light Display Manager 1.10 series:
New
Status in Light Display Manager 1.14 series:
New
Status in Light Display Manager 1.16 series:
New
Status in lightdm package in Ubuntu:
Fix Released
Bug description:
Until now, I've been using good old gdm-2.20.11 and wanted to switch
to lightdm-1.12.1. If you list users logged in via the 'w' or 'who'
command, it shows you who is logged in and what they are doing.
Especially, on which tty. Example:
USER TTY LOGIN@ IDLE JCPU PCPU WHAT
user tty9 03Oct14 16days 1:52m 0.01s /bin/sh /etc/xdg/xfce4/xinitrc
-- /etc/X11/xinit/xserverrc
Also, 'who' gives this information:
user tty9 Oct 3 22:34 (:20)
However, lightdm does not follow that tradition. Instead, it prints :0
instead of the actual tty, and something weird for other values (like
?xdm? instead of the idle value etc.)
'w':
USER TTY LOGIN@ IDLE JCPU PCPU WHAT
user :0 19:50 ?xdm? 23.82s 0.01s /bin/sh /etc/xdg/xfce4/xinitrc
-- /etc/X11/xinit/xserverrc
Note: :0 is not tty, it is DISPLAY env.
'who':
user :0 2014-10-12 19:50 (:0)
The same for this one. I wonder, is this a bug (to me it seems so,
because for every other program the correct values are reported)?
It is a problem for me, because I have written scripts for automation
etc. that parse w and who output to determine which tty is in use by
which DISPLAY.
To manage notifications about this bug go to:
https://bugs.launchpad.net/lightdm/+bug/1380364/+subscriptions
--
Mailing list: https://launchpad.net/~desktop-packages
Post to : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help : https://help.launchpad.net/ListHelp