Re: last, lastlog, and desktop sessions

2013-08-15 Thread Joel Rees
On Sat, Aug 10, 2013 at 3:08 AM, Bob Proulx b...@proulx.com wrote:

 Joel Rees wrote:
  Joel Rees wrote:
   I've never been clear about the last command. My memory is that it
   recorded logins to the desktop as well as to ttyn devices.

 To be pedantic the last command isn't recording anything.  It is
 only reporting what has already been recorded.


Yeah, that has become clear as I dig into this.


   Today, I'm checking my logs, and I don't see any record of logins
   to the desktop unless the user also started a shell in a virtual
   terminal.

 That would be due to your xdm, gdm, gdm3, lightdm, kdm or other
 graphical login manager.


I recently switched from gdm or gdm3 (don't remember which) to lightdm.


  It is responsible for recording desktop
 logins.  Some do.  Some do not.  If they don't then I think that is a
 bug.  But people who know about last and logins are becoming fewer
 every day and so this part of the system has atrophied.


erk.


   Has this changed recently? I'm I imagining things? Is there some
 setting
   that changes this, that might have changed when I upgraded from
 squeeze to
   wheezy?

 Try different graphical login managers and compare them.

  Okay, I finally decided to log out of my X11 session on my netbook
 (Fedora)
  and found that my memory was wrong.
 
  last does not report logins to X11 desktop sessions.

 What graphical login manager are you using?  As I recall lightdm for
 example does not record this information.  I am pretty sure I saw that
 there was a bug report on it.  Ah...  Here it is:

   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=648604


Oh! Lookie there!

The relevant line from the bug report:

 In order to have lightdm write to the last log, you have to enable the
 pam_lastlog.so module in /etc/pam.d/lightdm with:

 session optional pam_lastlog.so

(I think I need to start getting familiar with the debian bug reporting
 processes and lists.)

Anyway, I added that line to /etc/lightdm and /etc/lightdm-autologin,
at the end, right before the @include common-password line, and I'm
getting login logs again. who works again, etc.

Thanks, Bob.


 [...]


--
Joel Rees


Re: last, lastlog, and desktop sessions

2013-08-09 Thread Joel Rees
Okay, I finally decided to log out of my X11 session on my netbook (Fedora)
and found that my memory was wrong.

last does not report logins to X11 desktop sessions.

Is there a command that does? I've been looking around the web, but so far
google just tells me that X11 has an error log, which I know about.

auth.log has the information, but it's mixed with a bunch of other stuff.

lightdm/lightdm.log seems to have the information, too, but the time shown
looks to be time from boot. I could write a script to extract just the
login lines from auth.log, but I want to think someone has already done it.
I mean, sure, grep sort of does the job:

sudo grep lightdm: pam_unix(lightdm:session): session opened for user
/var/log/auth.log

but I'm sure there's a more general solution.

On Sat, Aug 3, 2013 at 8:39 AM, Joel Rees joel.r...@gmail.com wrote:

 I've never been clear about the last command. My memory is that it
 recorded logins to the desktop as well as to ttyn devices. Today, I'm
 checking my logs, and I don't see any record of logins to the desktop
 unless the user also started a shell in a virtual terminal.

 Has this changed recently? I'm I imagining things? Is there some setting
 that changes this, that might have changed when I upgraded from squeeze to
 wheezy?

 --
 Joel Rees




-- 
--
Joel Rees


Re: last, lastlog, and desktop sessions

2013-08-09 Thread Bob Proulx
Joel Rees wrote:
 Joel Rees wrote:
  I've never been clear about the last command. My memory is that it
  recorded logins to the desktop as well as to ttyn devices.

To be pedantic the last command isn't recording anything.  It is
only reporting what has already been recorded.

  Today, I'm checking my logs, and I don't see any record of logins
  to the desktop unless the user also started a shell in a virtual
  terminal.

That would be due to your xdm, gdm, gdm3, lightdm, kdm or other
graphical login manager.  It is responsible for recording desktop
logins.  Some do.  Some do not.  If they don't then I think that is a
bug.  But people who know about last and logins are becoming fewer
every day and so this part of the system has atrophied.

  Has this changed recently? I'm I imagining things? Is there some setting
  that changes this, that might have changed when I upgraded from squeeze to
  wheezy?

Try different graphical login managers and compare them.

 Okay, I finally decided to log out of my X11 session on my netbook (Fedora)
 and found that my memory was wrong.

 last does not report logins to X11 desktop sessions.

What graphical login manager are you using?  As I recall lightdm for
example does not record this information.  I am pretty sure I saw that
there was a bug report on it.  Ah...  Here it is:

  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=648604

What terminal emulator are you using?  Xterm records this
information.  But I assume that like the desktop managers that some
terminal emulators have fallen out of recording it.  Plus many people
today log into a system and never start a terminal emulator, doing
everything they want to do through other graphical applications.  If a
user only starts a web browser, file manager, office applications,
then there won't be any terminal emulators started.

 Is there a command that does? I've been looking around the web, but so far
 google just tells me that X11 has an error log, which I know about.

What you are asking for is not possible.  If the login manager does
not record the information then that information is not recorded.

 auth.log has the information, but it's mixed with a bunch of other stuff.

Right.

 lightdm/lightdm.log seems to have the information, too, but the time shown
 looks to be time from boot. I could write a script to extract just the
 login lines from auth.log, but I want to think someone has already done it.
 I mean, sure, grep sort of does the job:

I assume you are running Stable?  If you want this functionality then
I suggest trying a different login manager until a fixed version of
lightdm appears.  I do like lightdm.  You could look to see if there
is a backport to Stable.

Bob


signature.asc
Description: Digital signature