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 Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/870297

Title:
  Lightdm logins not being logged in wtmp

To manage notifications about this bug go to:
https://bugs.launchpad.net/lightdm/+bug/870297/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to