I've written a patch that updates utmp and uses pam_lastlog for wtmp. It seems to work:
root@test-precise:~# w 18:22:27 up 1:16, 2 users, load average: 2.44, 1.03, 0.68 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root pts/0 remotehost 17:06 0.00s 3.40s 0.01s w lotheac tty7 18:23 1:17m 1.07s 0.67s awesome But, there's a problem: since the greeter session is started the same way as the user session, we get unnecessary entries by the lightdm user when the login screen is visible: root@test-precise:~# who root pts/0 2012-04-19 17:06 (this is an ssh session) lightdm tty7 2012-04-19 18:05 root@test-precise:~# w 18:06:50 up 1:00, 2 users, load average: 0.59, 0.41, 0.42 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root pts/0 remotehost 17:06 0.00s 3.03s 0.01s w lightdm tty7 18:05 1:00m 0.36s 0.01s /bin/sh /usr/lib/lightdm/lightdm-greeter-session /usr/sbin/lightdm-gtk-greeter root@test-precise:~# last -n3 lightdm :0 Thu Apr 19 18:05 still logged in lotheac :0 Thu Apr 19 17:56 - 18:05 (00:09) lightdm :0 Thu Apr 19 17:56 - 17:56 (00:00) wtmp begins Mon Apr 16 14:40:28 2012 I don't think greeter sessions should be handled identically to user sessions; I'm not sure why it needs to go through the pam stack at all. Maybe someone more familiar with lightdm can shed some light on this? The attached patch isn't finished, since it introduces the issue described above. ** Patch added: "update utmp on session start and use pam_lastlog to record wtmp/lastlog" https://bugs.launchpad.net/ubuntu/oneiric/+source/lightdm/+bug/870297/+attachment/3094021/+files/utmp.patch -- 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/870297 Title: Lightdm logins not being logged in wtmp Status in Light Display Manager: Confirmed Status in “lightdm” package in Ubuntu: Confirmed Status in “lightdm” source package in Oneiric: Confirmed Status in “lightdm” source package in Precise: Confirmed Bug description: When logged into a graphical session, I get no acknowledgement from who, w or last that I am logged in: $ who $ w 16:48:14 up 1 day, 1:08, 0 users, load average: 0.68, 0.83, 0.84 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT last only reports tty logins, not graphical logins. ProblemType: Bug DistroRelease: Ubuntu 11.10 Package: lightdm 1.0.1-0ubuntu6 ProcVersionSignature: Ubuntu 3.0.0-12.19-generic-pae 3.0.4 Uname: Linux 3.0.0-12-generic-pae i686 NonfreeKernelModules: fglrx ApportVersion: 1.23-0ubuntu2 Architecture: i386 Date: Fri Oct 7 16:47:23 2011 InstallationMedia: Xubuntu 11.10 "Oneiric Ocelot" - Beta i386 (20110921.3) ProcEnviron: LANGUAGE=en_CA:en PATH=(custom, user) LANG=en_CA.UTF-8 SHELL=/bin/bash SourcePackage: lightdm UpgradeStatus: No upgrade log present (probably fresh install) To manage notifications about this bug go to: https://bugs.launchpad.net/lightdm/+bug/870297/+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

