LXDM logins not being logged in utmp
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxdm (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
This is basically the same as bug #870297, but for LXDM.
Systems using LXDM have no entries in the utmp record for logins, so tools like 'w' and 'who' do not show LXDM sessions.
Testcase:
1. Start Lubuntu system
2. Log into session
3. Open gnome-terminal
4. Run 'who' command
Expected result:
You should see TWO entries (the first is from LXDM, the second is from gnome-terminal):
tty7 YYYY-MM-DD HH:MM
pts/0 YYYY-MM-DD HH:MM (:0)
Observed result:
You see only one entry:
pts/0 YYYY-MM-DD HH:MM (:0)
Additional info:
Used gnome-terminal just for consistency with the LightDM report; lxterminal also doesn't seem to update login records so if you use it instead, observed result is actually "no entries at all" (and issue for another report). Also, bug #1027805 about wtmp records is similarly applicable to LXDM, but that remains to be fixed even in LightDM...
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: lxdm 0.4.1-0ubuntu6
ProcVersionSign
Uname: Linux 3.2.0-50-generic i686
ApportVersion: 2.0.1-0ubuntu17.4
Architecture: i386
Date: Sun Jul 14 18:50:56 2013
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release i386 (20101007)
MarkForUpload: True
SourcePackage: lxdm
UpgradeStatus: Upgraded to precise on 2012-07-30 (348 days ago)
I don't think the authors consider this a bug. As of 18.04, it's still hardcoded this way. The following is one of two essentially (for your purposes) identical instances:
src/lxterminal. c:1252: fork_command_ full(
VTE_ TERMINAL( term->vte) ,
VTE_ PTY_NO_ LASTLOG | VTE_PTY_NO_UTMP | VTE_PTY_NO_WTMP,
pwd,
exec,
env,
G_ SPAWN_SEARCH_ PATH | G_SPAWN_ FILE_AND_ ARGV_ZERO,
NULL,
NULL,
& term->pid,
NULL) ;
vte_terminal_
Probably, replacing those flags with a zero in both cases would be sufficient for a personal system, although I haven't checked for unanticipated consequences.
In my opinion, they should have at least made it an option to configure.
I did a quick test just now, of manually zeroing the argument in gdb, which verified that something like the following should work:
Probably something like:
#if USE_UTMP
#define LOG_UTMP VTE_PTY_NO_LASTLOG | VTE_PTY_NO_UTMP | VTE_PTY_NO_WTMP
#else
#define LOG_UTMP 0
#endif
except it only works for root, presumably because before the call to the fork (or spawn) routine, there must be a setuid call that is too early. I hope it's not in the vte library, but I doubt it, if other terminals (such as xterm) do the right thing.