Lightdm logins not being logged in utmp

Bug #870297 reported by ToZ
360
This bug affects 63 people
Affects Status Importance Assigned to Milestone
Light Display Manager
Fix Released
High
Unassigned
lightdm (Ubuntu)
Fix Released
High
Robert Ancell
Oneiric
Won't Fix
Low
Unassigned
Precise
Fix Released
High
Robert Ancell

Bug Description

Impact:
Systems using LightDM have no entries in the utmp record for logins, so tools like 'w' and 'who' do not show LightDM sessions.

Testcase:
1. Start Ubuntu system
2. Log into session
3. Open gnome-terminal
4. Run 'who' command
Expected result:
You should see TWO entries (the first is from LightDM, the second is from gnome-terminal):
<username> tty7 YYYY-MM-DD HH:MM
<username> pts/0 YYYY-MM-DD HH:MM (:0)
Observed result:
You see only one entry:
<username> pts/0 YYYY-MM-DD HH:MM (:0)

Regression potential:
Bugs in utmp code cause cause issues logging in

Related branches

Revision history for this message
ToZ (toz) wrote :
ToZ (toz)
visibility: private → public
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in lightdm (Ubuntu):
status: New → Confirmed
Revision history for this message
Brian Vaughan (bgvaughan) wrote :

Here's a copy and paste of what I posted on ubuntuforums.org:

Users logged in via GUI not listed by 'who', 'w', or 'last'.
It looks like some update on September 30 or October 1 inhibits correct tracking of GUI logins. At a guess, I think lightDM is not updating /var/log/wtmp. I'm not sure, though, and I'd appreciate suggestions on how to narrow it down so I can make a proper bug report.

I often log in to my desktop via ssh, then execute 'w' or 'who' to see if anyone is logged in, before I do any work on my system. I executed 'w', found that there was only one user logged in, which was me, then I started x11vnc and connected to my desktop, only to see that my stepson was logged in and playing Minecraft. I tried 'who', and it indicated only my login; 'last' didn't show my son's login today.

'last' did show his login via GUI from yesterday, before I applied a batch of updates, so that's why I think this was just broken:
Code:

kidongui tty7 :0 Thu Sep 1 16:50 - 21:37 (04:46)

I did see that his processes were correctly listed by 'ps' and 'top'.

Revision history for this message
Sebastien Bacher (seb128) wrote : Re: Lightdm logins not being logged in wtmp

Thank you for your bug report, it seems like it could be an accountsservice issue fixed in the next version:
http://cgit.freedesktop.org/accountsservice/commit/?id=b73f539602f74271650a102d90253dc697488478

Changed in lightdm (Ubuntu):
importance: Undecided → Low
summary: - Lightdm logins not being logged in wmtp
+ Lightdm logins not being logged in wtmp
Revision history for this message
Sebastien Bacher (seb128) wrote :

could somebody try with the new version?

security vulnerability: yes → no
Revision history for this message
Gerry (gsker) wrote :

I just did. It did not work. Sadly.

Revision history for this message
Gerry (gsker) wrote :

The idea might be good, but a preliminary glance makes me wonder whether installing that library is sufficient.

  % dpkg-query -S /usr/lib/libaccountsservice.so.0.0.0
  libaccountsservice0: /usr/lib/libaccountsservice.so.0.0.0

  %ldd /usr/lib/accountsservice/accounts-daemon | grep libaccount

returns nothing. Do I have to recompile accounts-daemon? Maybe; I'll look into it.

Revision history for this message
Gerry (gsker) wrote :

I compiled it all and made sure that code was there and installed it and it still doesn't show up. Then I got the source from git and tried it again. No love. I guess I'll try gdm and see if it does it too.

Revision history for this message
Gerry (gsker) wrote :

Is lightdm really using accountsservice? It's not listed as a dependency nor even recommends. gdm behaves correctly and depends on accountsservice.

I'm inclined to believe that it's behaving incorrectly with regards the dbus interaction, but that's all way over my head. Let me know if you want me to test anything.

Revision history for this message
Sebastien Bacher (seb128) wrote :

> Is lightdm really using accountsservice? It's not listed as a dependency nor even recommends. gdm behaves correctly and depends on accountsservice.

liblightdm-gobject-1-0 Recommends it, and it's used over dbus yes

Revision history for this message
Forest (foresto) wrote :

This may be the underlying cause of bug #896663.

Changed in lightdm (Ubuntu Precise):
assignee: nobody → Robert Ancell (robert-ancell)
milestone: none → ubuntu-12.04-beta-1
Changed in lightdm (Ubuntu Oneiric):
importance: Undecided → Low
status: New → Confirmed
Changed in lightdm:
status: New → Confirmed
Revision history for this message
Matthias Schiffer (neoraider) wrote :

Is this going to be fixed in Oneiric? While the login logs are rather unimportant on single-user desktop systems, they are very important on computers used by many people. This is one of the problems that currently blocks deployment of Xubuntu 11.10 at our university. (We'd rather not wait for 12.04 if possible as our current 10.10 system has issues with some of our newer hardware)

Revision history for this message
Harald Hannelius (harald-arcada) wrote :

We are also an educational org and this affects us too. We are unable to use our utmp/wtmp-based tools to monitor lab-usage.

Changed in lightdm:
importance: Undecided → High
Changed in lightdm (Ubuntu Precise):
importance: Low → High
Revision history for this message
Sebastien Bacher (seb128) wrote :

Ok, some pointers in case that's useful, gdm has code in gdm-session-record.c

void
gdm_session_record_login (GPid session_pid,
...
        /* Handle wtmp */
        g_debug ("Writing wtmp session record to " GDM_NEW_SESSION_RECORDS_FILE);
#if defined(HAVE_UPDWTMPX)
        updwtmpx (GDM_NEW_SESSION_RECORDS_FILE, &session_record);
#elif defined(HAVE_UPDWTMP)
        updwtmp (GDM_NEW_SESSION_RECORDS_FILE, &session_record);
#elif defined(HAVE_LOGWTMP) && defined(HAVE_UT_UT_HOST)
#if defined(HAVE_UT_UT_USER)
        logwtmp (session_record.ut_line, session_record.ut_user, session_record.ut_host);
#elif defined(HAVE_UT_UT_NAME)
        logwtmp (session_record.ut_line, session_record.ut_name, session_record.ut_host);
#endif
#endif

        /*
         * Handle utmp
         * Update if entry already exists
         */
#if defined(HAVE_GETUTXENT)
        setutxent ();

        while ((u = getutxent ()) != NULL) {
                if (u->ut_type == USER_PROCESS &&
                    (session_record.ut_line != NULL &&
                     (strncmp (u->ut_line, session_record.ut_line,
                               sizeof (u->ut_line)) == 0 ||
                      u->ut_pid == session_record.ut_pid))) {
                        g_debug ("Updating existing utmp record");
                        pututxline (&session_record);
                        break;
                }
        }
        endutxent ();

        /* Add new entry if update did not work */
        if (u == NULL) {
                g_debug ("Adding new utmp record");
                pututxline (&session_record);
        }
#elif defined(HAVE_LOGIN)
 login (&session_record);
#endif
}
..."

So it seems it's somewhat that is not integrated with the system stack but that lightdm should be doing by itself on login

tags: added: rls-mgr-p-tracking
Revision history for this message
Harvey Muller (hlmuller) wrote :

Matthias said above, "...the login logs are rather unimportant on single-user desktop systems,...".

This is not entirely correct. Those who still use acpi-support for their machines depend on logins being properly logged in utmp/wtmp. If /usr/bin/who does not report the logged in user, then /usr/share/acpi-support/power-funcs will fail, and then so will everything else depending on it, for example /etc/acpi/asus-touchpad.sh (for starters).

Fixing this bug will probably fix some hardware issues for a few folks out there, aside from myself.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

With lightdm 1.1.4 I am getting who/w records (and wasn't in 1.1.3). This version has a major restructuring in the way PAM is accessed and may have fixed it?!

bob@alchemy:~$ who
bob pts/0 2012-03-02 09:22 (:0)
bob@alchemy:~$ w
 09:22:06 up 20 min, 1 user, load average: 1.06, 0.56, 0.48
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
bob pts/0 :0 09:22 0.00s 0.28s 0.00s w

Could someone who uses these records please check this version - it's in the precise queue and will be there after beta 1 freeze ends, or is available in the ubuntu-desktop PPA now (https://launchpad.net/~ubuntu-desktop/+archive/ppa).

Revision history for this message
ToZ (toz) wrote :

Interesting. Just installed the new precise beta 1 and it seems to work again (but lightdm=1.1.3)

$ apt-cache policy lightdm
lightdm:
  Installed: 1.1.3-0ubuntu1
  Candidate: 1.1.3-0ubuntu1
  Version table:
 *** 1.1.3-0ubuntu1 0
        500 http://ca.archive.ubuntu.com/ubuntu/ precise/main i386 Packages
        100 /var/lib/dpkg/status

$ who
toz pts/0 2012-03-01 21:04 (:0)

$ w
 21:28:19 up 26 min, 1 user, load average: 0.36, 0.66, 0.87
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
toz pts/0 :0 21:04 0.00s 0.59s 0.01s w

Martin Pitt (pitti)
Changed in lightdm (Ubuntu):
milestone: ubuntu-12.04-beta-1 → ubuntu-12.04-beta-2
Revision history for this message
Elfy (elfy) wrote :

Still no users here.

07:23:26 up 5 min, 0 users, load average: 0.36, 0.84, 0.47

Installed: 1.1.3-0ubuntu1

Revision history for this message
Olivier Cortès (olive) wrote :

Here on up-to-date Oneiric.

I rely on this feature to display remote messages to the logged-in user.
On networked Ubuntu stations this is very important to my programs, else the user won't know his workstation will shutdown !!
With this bug, my program sees no-one connected and no message can be displayed. Very Sad.

Any workarounds on Oneiric to get the user connected to the graphical session ? (besides re-installing GDM...)

I see the priority is low for Oneiric. Is it planned to be fixed or will it be fixed only in Precise ?

regards,

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Oliver, if the fix is due to the changes made in the precise version then no, this change will not be done in Oneiric (too complex to backport).

forestpiskie, did you restart lightdm before checking?

Revision history for this message
Elfy (elfy) wrote :

Numerous reboots since.

w
 07:21:15 up 27 min, 0 users, load average: 1.44, 0.91, 0.56
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT

After a login on tty1

w
 07:22:25 up 28 min, 1 user, load average: 0.65, 0.80, 0.55
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
hob tty1 07:22 9.00s 0.59s 0.47s -bash

Martin Pitt (pitti)
tags: added: rls-p-tracking
removed: rls-mgr-p-tracking
Revision history for this message
Balwinder S Dheeman (bdheeman) wrote :

I attempted to build and install debian packages for updated lightdm + lightdm-gtk-greeter 1.1.4 yesterday, which went fine; I'm expert enough APT user and prefer installing software as packages.

I found that plain old /bin/login also stopped updating /run/utmp /var/log/btmp and, or /var/log/wtmp; the /run is tmpfs mount on Debian these days and /var/run is a symlink to /run

IMHO, something is or may wrong with pam files on Debian; hence w and who report nothing under X and, or over tty terminals.

I have:

[bsd@mon ~]$ uapt version lightdm
1.1.4-1
[bsd@mon ~]$ uapt version lightdm-gtk-greeter
1.1.4-1
[bsd@mon ~]$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux testing (wheezy)
Release: testing
Codename: wheezy

The lightdm and lightdm-gtk-greeter packages for Debian can be installed from http://anu.homelinux.net/pub/Debian/

Revision history for this message
ToZ (toz) wrote :

And its gone (after some updates).

$ apt-cache policy lightdm
lightdm:
  Installed: 1.1.6-0ubuntu1
  Candidate: 1.1.6-0ubuntu1
  Version table:
 *** 1.1.6-0ubuntu1 0
        500 http://ca.archive.ubuntu.com/ubuntu/ precise/main i386 Packages
        100 /var/lib/dpkg/status

$ w
 21:57:39 up 3 min, 0 users, load average: 4.06, 2.31, 0.95
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT

$ who

Revision history for this message
Elfy (elfy) wrote :

More updates - no change

$ apt-cache policy lightdm
lightdm:
  Installed: 1.1.7-0ubuntu1
  Candidate: 1.1.7-0ubuntu1
  Version table:
 *** 1.1.7-0ubuntu1 0
        500 http://gb.archive.ubuntu.com/ubuntu/ precise/main i386

Packages
        100 /var/lib/dpkg/status

$ w
 20:29:37 up 4:16, 0 users, load average: 0.17, 0.13, 0.14
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT

$ who

Revision history for this message
Harvey Muller (hlmuller) wrote :

Bob,

Sorry for the delayed response.

In Oneiric, 'who' and 'w' report the logged in user, but only from an active open terminal. What this means for example, is that the asus-touchpad.sh script provided by acpi-support only works properly when run from a terminal. When the script is run by udev, 'who' does not report the logged in user, because lightdm, unlike gdm, does not currently seem to modify utmp/wtmp.

I will test a recent Precise daily-live as you have requested to see if this behavior has changed.

Best,

Harvey

tags: removed: rls-p-tracking
tags: added: rls-mgr-p-tracking
Revision history for this message
Martin Pitt (pitti) wrote :

This works fine for me on current precise. Can you confirm that you can still reproduce this?

Changed in lightdm (Ubuntu Precise):
milestone: ubuntu-12.04-beta-2 → ubuntu-12.04
Revision history for this message
Alex Bachmeier (cebalrai) wrote :

I can still reproduce this on my lab machines with all updates installed.

Mar 26 12:05:28 $HOSTNAME lightdm: pam_unix(lightdm:session): session opened for user $USER by (uid=0)
Mar 26 12:05:28 $HOSTNAME lightdm: pam_ck_connector(lightdm:session): nox11 mode, ignoring PAM_TTY :0
Mar 26 12:05:32 $HOSTNAME polkitd(authority=local): Registered Authentication Agent for unix-session:/org/freedesktop/ConsoleKit/Session2 (system bus name :1.41 [/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1], object path /org/gnome/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)

while last shows nothing:
---# last -n 10
root pts/0 devel01.informat Mon Mar 26 12:52 still logged in
reboot system boot 3.2.0-20-generic Mon Mar 26 12:05 - 12:54 (00:49)
reboot system boot 3.2.0-20-generic Mon Mar 26 12:02 - 12:54 (00:51)
reboot system boot 3.2.0-20-generic Mon Mar 26 12:00 - 12:54 (00:53)

w only shows my ssh session
---# w
 12:54:58 up 50 min, 1 user, load average: 0.00, 0.01, 0.05
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 $REMOTE_HOST 12:52 0.00s 0.38s 0.00s w

console kit can display the session:

---# ck-list-sessions
Session2:
        unix-user = '14443'
        realname = 'Meow Meow'
        seat = 'Seat1'
        session-type = ''
        active = TRUE
        x11-display = ':0'
        x11-display-device = '/dev/tty7'
        display-device = ''
        remote-host-name = ''
        is-local = TRUE
        on-since = '2012-03-26T10:05:28.151601Z'
        login-session-id = '4294967295'

Revision history for this message
ToZ (toz) wrote :

I confirm Alex's findings. Fully updated, no logging.

It worked briefly for me (see post #17), but after an update it stopped again. Its interesting that it works sometimes for some people but not others. Not sure if it might be helpful, but attached is a listing of all the installed versions of lightdm's dependencies. From:

$ for i in $(apt-cache depends lightdm | grep Depends | awk '{ print $2 }'); do dpkg -l | grep $i; done

Revision history for this message
Elfy (elfy) wrote :

I too can confirm the issue.

I have 3 machines all running completely updated 12.04 Xubuntu.

None show any users.

2 of the machines are upgraded from 11.10 Xubuntu - the other was a clean install of 12.04

This one has also got a 12.04 Ubuntu partition - when this is booted it show's 1 user as expected.

Revision history for this message
Elfy (elfy) wrote :

Clean install of Xubuntu Beta 2 and updated.

hobgoblin@hobgoblin:~$ w
 09:49:18 up 1 min, 0 users, load average: 2.41, 0.75, 0.26
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT

Revision history for this message
Michael Hood (michaelhood) wrote :

I'm on an updated Ubuntu 12.04 (as opposed to Xubuntu), and can still confirm this issue..

`ck-list-sessions` does show the session properly.

Revision history for this message
Martin Pitt (pitti) wrote :

Dropping milestone. Not reproducible easily, and this is SRUable.

Changed in lightdm (Ubuntu Precise):
milestone: ubuntu-12.04 → none
Martin Pitt (pitti)
no longer affects: acpi-support (Ubuntu Precise)
no longer affects: acpi-support (Ubuntu Oneiric)
no longer affects: acpi-support (Ubuntu)
Revision history for this message
Adam Conrad (adconrad) wrote :

For what it's worth, I get no utmp/wtmp love here either. Martin wanted me to comment in case Robert wanted to use me or my laptop as a guinea pig. :P

Revision history for this message
Raphaël Hertzog (hertzog) wrote : Re: [Bug 870297] Re: Lightdm logins not being logged in wtmp

On Wed, 18 Apr 2012, Adam Conrad wrote:
> For what it's worth, I get no utmp/wtmp love here either. Martin wanted
> me to comment in case Robert wanted to use me or my laptop as a guinea
> pig. :P

I wonder if the person who are not affected are using a session that's not
the default one?

Maybe something else in the stack is doing the utmp/wtmp recording for
them (gnome-session?).

Cheers,
--
Raphaël Hertzog ◈ Debian Developer

Pre-order a copy of the Debian Administrator's Handbook and help
liberate it: http://debian-handbook.info/liberation/

Revision history for this message
Alex Bachmeier (cebalrai) wrote : Re: Lightdm logins not being logged in wtmp

I'm running precise in a computer lab, so maybe I can shed some light on your theory:
We have roughly 10 different desktop environments installed
current statistics:

host 1: gnome-session --session=buntu, no user in w
host 2: gnome-session --session=ubuntu, no user in w
host 3: gnome-session --session=ubuntu, no user in w
host 4: gnome-session --session=ubuntu, no user in w
host 5: gnome-session --session=gnome-classic, no user in w
host 6: gnome-session --session=ubuntu, user shows up in w
host 7: gnome-session --session=ubuntu, user shows up in w

In the two cases where the user shows up, both users have a gnome-terminal open.

Revision history for this message
Raphaël Hertzog (hertzog) wrote : Re: [Bug 870297] Re: Lightdm logins not being logged in wtmp

On Wed, 18 Apr 2012, Alex Bachmeier wrote:
> In the two cases where the user shows up, both users have a gnome-
> terminal open.

That doesn't count. We're interested in lines that correspond
to the main login. They have a local TTY like this (here paste
from my debian unstable box but it should be similar for ubuntu):

USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
rhertzog tty7 :0 10Apr12 7days 1:41m 4.76s gnome-session

Notice that we have "tty7" in the TTY field and not "pts/<number>".

Cheers,
--
Raphaël Hertzog ◈ Debian Developer

Pre-order a copy of the Debian Administrator's Handbook and help
liberate it: http://debian-handbook.info/liberation/

Revision history for this message
Sebastien Bacher (seb128) wrote : Re: Lightdm logins not being logged in wtmp

The reason that issue seems to be "stucked" is the lack of clear documentation about wtmp, why it's useful, how it's managed and if lightdm is the "right" place that handling should be done (compared to i.e pam or some other place).

Does anyone have some "specs" or clear documentation on the topic which would document what needs to be done and why and help to understand if lightdm is the "right place"?

The gdm copied code before suggest lightdm should call pututxline() on login, is there really the right thing to do or is that "legacy code"? Lightdm tries to avoid doing stuff "just because that's how it has been copied around since unix" and rather get issues fixed at the right place

Robert, is that an accurate summary of the situation?

Revision history for this message
Lauri Tirkkonen (lotheac) wrote :

I looked into this a bit. There is a pam module that updates lastlog and wtmp (pam_lastlog(8)), which could be stacked in the lightdm pam config. It doesn't update utmp, however, and utmp is what w(1) and who(1) look at -- see the discussion at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=659957.

I guess as it stands, lightdm needs to write the utmp entry, like login(1), since nothing else does. I also propose to add the pam_lastlog module to lightdm's stack to keep lastlog and wtmp up to date.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Sebastian, that sums it up exactly.

Revision history for this message
Lauri Tirkkonen (lotheac) wrote :

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.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "update utmp on session start and use pam_lastlog to record wtmp/lastlog" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Manuel Iglesias Alonso (glesialo) wrote : Re: Lightdm logins not being logged in wtmp

A fresh install of the definitive release of precise (Ubuntu 12.04) still shows this bug :-(
Venerable commands like 'w' and 'who' should work correctly in each and every distro!

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Lauri, great work! You should move the code to the same location as ck_open_session and check if the record shouldn't be written for greeters then skip if class is XDG_SESSION_CLASS_GREETER.

Revision history for this message
Lauri Tirkkonen (lotheac) wrote :

Robert, but that wouldn't help for wtmp/lastlog, since pam is still used. Is there a reason it is for greeters, though, and should greeters really have a consolekit session either? Couldn't we just simply fork without doing most of the stuff in session_child_run if we're starting a greeter?

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Unfortunately greeters need to have a console kit session as they access console kit to perform shutdown/restart and that requires a session to be open.

Revision history for this message
Lauri Tirkkonen (lotheac) wrote :

Ok, but what about PAM? Greeters should run as the same user lightdm does, so authentication is already skipped for them (do_authenticate is false), but do pam_open_session or pam_acct_mgmt make sense? If we skip pam_open_session for greeters, we can use pam_lastlog for actual user sessions, but I'm thinking we should skip PAM altogether if it's not an actual user session. That would require some refactoring.

Changed in lightdm (Ubuntu Precise):
milestone: none → ubuntu-12.04.1
Changed in lightdm (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Elfy (elfy) wrote :

Quantal is the same here. Though it might be premature to comment on that at the moment.

Revision history for this message
Karolis (reklamukibiras) wrote :

i have this issue on xubuntu 12.04. lightdm version 1.2.1-0ubuntu1
i'm only half year old in linux world but in very beginning i remember being very confused when who and w didn't produse output. didn't consider this as a bug back then but more like un-fully-thought-about function or my lack of experience. now finding that this is an actual bug i can only express some positive wishing thoughts, as i am not as confident yet about getting involved deeper into fixing it

Revision history for this message
Sebastien Bacher (seb128) wrote :

@Lauri: thanks for your work there, is there any issue left with your patch? Is the issue that the greeter sessions are counted as logins with it?

Revision history for this message
Lauri Tirkkonen (lotheac) wrote :

Sebastien, yeah, that's the issue. I'm working on skipping PAM for user sessions right now, actually, but it's probably going to be a little ugly since I'm trying to keep the changes small.

On a side note, does lightdm have an IRC channel this could be discussed in? I couldn't seem to find a reference to one.

Revision history for this message
Lauri Tirkkonen (lotheac) wrote :

... sorry, that should be "skipping PAM for non-user sessions"

Revision history for this message
Sebastien Bacher (seb128) wrote :

@Lauri: I don't think lightdm has an IRC channel but you can find most of people working on it on #ubuntu-desktop @ irc.ubuntu.com, robert_ancell is usually there during .nz work hours but you should find people online during european or american work hours as well

Revision history for this message
Lauri Tirkkonen (lotheac) wrote :

Ok, now that I've finally figured out how exactly lightdm works in this regard, I've pushed my changes to lp:~lotheac/lightdm/utmpx.

At first, I was trying to check for XDG_SESSION_CLASS_USER, but it seems that is never set. The authentication session (which talks to the greeter) has no class, and that same session is used to start the user's process (hence it needs PAM very much). If authentication fails, the authentication session is restarted. I just check if we're a greeter after authentication, and if so, skip pam_{open,close}_session and write the utmpx entry.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks a lot Lauri, is there any chance you could also open a merge request against lp:lightdm (i.e the upstream project)? I'm not sure the upstream maintainers are watching the Ubuntu branches as regularly as they watch the work going on the project

Revision history for this message
Lauri Tirkkonen (lotheac) wrote :

Okay. I moved the branch based on ubuntu/precise/lightdm to lp:~lotheac/lightdm/utmpx_precise and the one based on upstream is lp:~lotheac/lightdm/utmpx. Upstream doesn't have debian/lightdm.pam though (since it's packaging stuff), so that should still be merged to the Ubuntu branch.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Support for utmp has been added to lighdm 1.3.1 and will be backported to 1.2.x when it is confirmed it works correctly.

Changed in lightdm:
status: Confirmed → Fix Committed
Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/870297

tags: added: iso-testing
Changed in lightdm:
status: Fix Committed → Fix Released
Changed in lightdm (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Stéphane Graber (stgraber) wrote :

Robert: This landed a few weeks ago in Quantal, assuming this worked fine, can you please prepare the SRUs and upload them now?

Changed in lightdm (Ubuntu Precise):
status: Confirmed → Triaged
Changed in lightdm (Ubuntu Oneiric):
status: Confirmed → Triaged
Changed in lightdm (Ubuntu):
status: Fix Released → Fix Committed
Changed in lightdm:
status: Fix Released → Fix Committed
description: updated
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Well, I checked and it didn't seem to be working at all. I've prepped the SRU but I'll upload the fix to Quantal next week and check it works there first.

Changed in lightdm:
status: Fix Committed → Fix Released
Revision history for this message
Elfy (elfy) wrote :

Working here on 12.10.

 07:25:14 up 3:03, 1 user, load average: 2.31, 1.66, 1.60
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT

Revision history for this message
Robert Ancell (robert-ancell) wrote :

elfy, that looks like it's not working for you - you should see two entries (see the bug description). I've just uploaded this to quantal now and precise-proposed.

Revision history for this message
Lauri Tirkkonen (lotheac) wrote :

The package in precise-proposed works for me.

lightdm 1.2.1-0ubuntu1.1
ltirkkon tty7 2012-07-17 10:33
 10:34:34 up 37 min, 1 user, load average: 0.55, 0.53, 0.49
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
ltirkkon tty7 10:33 37:24 1.13s 0.09s /bin/sh /etc/xd

However, the included pam config doesn't stack pam_lastlog, so wtmp is still not being updated (it should show my desktop session as 'still logged in'):
flashman ~ % ssh root@test-precise 'dpkg-query --show lightdm && last -n1'
lightdm 1.2.1-0ubuntu1.1
root pts/0 flashman Tue Jul 17 10:32 - 10:32 (00:00)

wtmp begins Fri Jul 13 19:23:13 2012

Revision history for this message
Elfy (elfy) wrote :

In Quantal - fully updated

w gives

09:15:03 up 3 min, 1 user, load average: 0.92, 0.79, 0.34
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
hob tty7 09:12 3:06 11.00s 0.02s /bin/sh /etc/xd

who gives

hob tty7 2012-07-17 09:12

and dpkg-query --show lightdm && last -n1 gives me

lightdm 1.3.2-0ubuntu1
reboot system boot 3.5.0-4-generic Tue Jul 17 09:12 - 09:18 (00:06)

wtmp begins Sun Jul 15 09:02:25 2012

Revision history for this message
ToZ (toz) wrote :

I confirm. Quantal, fully updated:

toz@quantalU:~$ w
 09:44:08 up 7 min, 2 users, load average: 1.03, 0.83, 0.41
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
toz tty7 09:42 6:50 11.24s 0.55s gnome-session -
toz pts/2 :0 09:42 0.00s 0.44s 0.02s w

toz@quantalU:~$ who
toz tty7 2012-07-17 09:42
toz pts/2 2012-07-17 09:42 (:0)

Kevin Green (kevgreen7)
Changed in lightdm (Ubuntu Precise):
status: Triaged → Fix Released
Revision history for this message
Scott Kitterman (kitterman) wrote :

@Kevin: There's been no fix for Precise on this yet, so please don't mark it fix released yet.

Changed in lightdm (Ubuntu Precise):
status: Fix Released → Triaged
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello ToZ, or anyone else affected,

Accepted lightdm into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/lightdm/1.2.1-0ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in lightdm (Ubuntu Precise):
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
Gerry (gsker) wrote : Re: Lightdm logins not being logged in wtmp

After applying the precise-proposed upgrade, The 'w' and 'who' commands now show an entry upon logging into a session via lightdm.

But the 'last' command still does not show that user as logged in.

Revision history for this message
ToZ (toz) wrote :

I can confirm Gerry's observations with precise-proposed:

toz@xubi:~$ who
toz tty7 2012-07-19 14:34

toz@xubi:~$ w
 14:35:15 up 3 min, 1 user, load average: 6.23, 4.33, 1.80
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
toz tty7 14:34 3:22 0.98s 0.00s /bin/sh /etc/xd

toz@xubi:~$ last | head -3
reboot system boot 3.2.0-26-generic Thu Jul 19 14:32 - 14:35 (00:03)
toz tty1 Thu Jul 19 14:28 - down (00:02)
toz tty1 Thu Jul 19 14:28 - 14:28 (00:00)

And this after one successful login and logout. Will check the last entry with Quantal.

Revision history for this message
ToZ (toz) wrote :

Yes, same results with last in quantal. Sorry, but didn't check last earlier.

Revision history for this message
Sebastien Bacher (seb128) wrote :

setting verification-done, while it's not perfect it's an improvement and verification-failed would make the upload be rejected until the whole issue is fixed, it's better to get part of it fixed and the remaining issues sorted later rather than getting nothing

tags: added: verification-done
removed: verification-needed
Revision history for this message
Lauri Tirkkonen (lotheac) wrote :

The 'last' issue is simple to fix: lp:~lotheac/lightdm/utmpx

Should I propose a merge to lp:ubuntu/precise-proposed/lightdm or somewhere else?

Revision history for this message
Lauri Tirkkonen (lotheac) wrote :

Sorry, that should've been lp:~lotheac/lightdm/wtmp_precise -- I'm too tired.

Revision history for this message
Manuel Iglesias Alonso (glesialo) wrote :

From ToZ (toz) message:
{
toz@xubi:~$ w
 14:35:15 up 3 min, 1 user, load average: 6.23, 4.33, 1.80
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
toz tty7 14:34 3:22 0.98s 0.00s /bin/sh /etc/xd
}

Display name (':0' or whatever ) is missing! It should be:
{
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
toz tty7 :0 14:34 3:22 0.98s 0.00s /bin/sh /etc/xd
}

Revision history for this message
Wart (wart-kobold) wrote :

I see the same behavior as Manuel. In Ubuntu 10.04, utmp.ut_host is filled in with the X display name (such as :0), but in the proposed update utmp.ut_host is left empty.

Revision history for this message
Manuel Iglesias Alonso (glesialo) wrote :

I have scripts that send graphical messages to logged-in users using the display names printed by 'w' or 'who'.
I have been using them, for more than a decade, with different Linux distros, but they would fail with this lightdm setup. :-(

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Manuel, Wart, I have opened a separate issue for that; see bug 1027760

summary: - Lightdm logins not being logged in wtmp
+ Lightdm logins not being logged in utmp
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Lauri, can you open a new bug on the last issue. I have some questions about it I will ask in the new bug.

Revision history for this message
Lauri Tirkkonen (lotheac) wrote :

Robert, ok: bug 1027805 is the wtmp issue.

Revision history for this message
Scott Kitterman (kitterman) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lightdm - 1.2.1-0ubuntu1.1

---------------
lightdm (1.2.1-0ubuntu1.1) precise-proposed; urgency=low

  * debian/patches/05_utmp.patch:
    - Add utmp support (LP: #870297)
 -- Robert Ancell <email address hidden> Tue, 17 Jul 2012 18:46:29 +1200

Changed in lightdm (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
David Guichard (david-guichard) wrote :

"This bug was fixed in the package lightdm - 1.2.1-0ubuntu1.1"

I have this package installed in a lab full of Precise machines, and logins still do not appear in wtmp.

Changed in lightdm (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
sudodus (nio-wiklund) wrote : Re: [Bug 870297] Re: Lightdm logins not being logged in utmp

On 2012-11-21 03:37, Robert Ancell wrote:
> ** Changed in: lightdm (Ubuntu)
> Status: Fix Committed => Fix Released
>
Great news!

I checked and it is working in Precise too.

best regards/nio

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Thank you for reporting this bug to Ubuntu. oneiric has reached EOL
(End of Life) and is no longer supported. As a result, this bug
against oneiric is being marked "Won't Fix". Please see
https://wiki.ubuntu.com/Releases for currently supported Ubuntu
releases.

Please feel free to report any other bugs you may find.

Changed in lightdm (Ubuntu Oneiric):
status: Triaged → Won't Fix
Revision history for this message
Amr Ibrahim (amribrahim1987) wrote :

I can't see the Guest session logged in from the Lightdm greeter screen. Ubuntu 12.04.

Revision history for this message
Adam Funk (a-funk) wrote :

Unless I'm misunderstanding something, I don't see that this bug has been fixed. I'm running Ubuntu 13.04 with lightdm and the "last" command's output still doesn't show lightdm logins.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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