You are not logged in.

#1 2015-10-13 12:17:02

cmsigler
Member
Registered: 2013-11-18
Posts: 35

[Solved, deprecated upstream] who -m and w don't show pty logins

Hi,

Silly and fairly minor, but nagging, problem:

The behaviour of terminal emulator login shells has recently changed on my Arch systems.  Even though I'm running a login shell -- ps shows zeroth argument as "-bash" and shopt "login_shell" is "on" -- my login doesn't show up in 'w' and 'who -m' returns an empty string.  These used to show up in 'last' as a login on, for example, pts/2 from :0.0.  Now, nothing.  Note that if I login on a tty or remotely/over network, my pty/tty shows up, *and*also* if I run a screen session.  (BTW, a screen login doesn't leave a permanent entry in /var/log/wtmp which I believe is expected behaviour.)  I don't have xterm installed (how times have changed) but this happens with both xfce4-terminal and gnome-terminal.

I don't have a lot of experience with system login management so I might be missing an obvious config problem or change.  I have libutempter installed and tried reinstalling it, FWIW.

I can't definitively isolate this to just a few packages since I didn't do an upgrade for a couple of weeks.  It's not related to the kernel upgrade to 4.2.2-1 as this change showed up on one system a few days after the kernel upgrade.  My usual suspect for something like this is systemd and related but on that box the problem didn't show up immediately after the latest systemd upgrade.

My only remaining suspect is the upgrade of libcap-ng (0.7.4-1 -> 0.7.7-1) but maybe I'm totally missing it.

Has anyone seen this behaviour on their systems?  I'd love it if someone bought me a clue....  TIA.

Clemmitt

Last edited by cmsigler (2015-10-13 17:43:07)

Offline

#2 2015-10-13 14:11:47

cmsigler
Member
Registered: 2013-11-18
Posts: 35

Re: [Solved, deprecated upstream] who -m and w don't show pty logins

Bad form to reply to oneself and all....

I couldn't find any bugs directly related to this.  But out of curiosity I dug deeper for anything vaguely related.  I found:

FS#46664
FS#46655
FS#46374

None of these seem to be an obvious cause, or perhaps the systemd/libcap problem, FS#46664?  Under XFCE4 gnome-terminal opens fine for me.  Still clueless....

Clemmitt

Offline

#3 2015-10-13 14:39:12

Painless
Member
Registered: 2006-02-06
Posts: 233

Re: [Solved, deprecated upstream] who -m and w don't show pty logins

Hi,

This was a bugbear of mine a while back.  Now `last` and `w` seem to work fine, and there is also `loginctl` to play with.

I think this may be related to which display manager you're using.  In the past, I used to use XDM (using lightdm now) and previously had to fiddle with /etc/X11/xdm/Xstartup, adding /usr/bin/sessreg commands to get `last` to record my logins, but this seems to have been fixed a while ago.

I also recall having to make some PAM changes to get sessions registered properly, but again this seems to be fixed because in a recent installation I did not have to make any changes.

Hope this provides some useful direction for you.  smile

Offline

#4 2015-10-13 14:49:34

dishaze
Member
From: Quebec
Registered: 2014-02-01
Posts: 6

Re: [Solved, deprecated upstream] who -m and w don't show pty logins

Seems like xfce4-terminal required gnome-pty-helper to register pseudo-terminals but last update to vte disabled it...

Last edited by dishaze (2015-10-13 14:49:48)

Offline

#5 2015-10-13 15:04:38

cmsigler
Member
Registered: 2013-11-18
Posts: 35

Re: [Solved, deprecated upstream] who -m and w don't show pty logins

Painless wrote:

I think this may be related to which display manager you're using.

I'm using lightdm, too, for years now.  Hmmm, lightdm was upgraded around the time my wtmp entries stopped....

Painless wrote:

I also recall having to make some PAM changes to get sessions registered properly, but again this seems to be fixed because in a recent installation I did not have to make any changes.

I've always been fuzzy about PAM (and a sysadmin shouldn't be).  I wondered about a PAM change but I couldn't find any config changes in /etc/pam.d/ .

dishaze wrote:

Seems like xfce4-terminal required gnome-pty-helper to register pseudo-terminals but last update to vte disabled it...

^^^ THIS.  I saw something somewhere in my reading about gnome-pty-helper.

If I run gnome-terminal under XFCE4, does gnome-terminal not use gnome-pty-helper?  gnome-terminal has the same problem *shrug*

I don't have a solution but between lightdm, PAM and gnome-pty-helper there must be something wrong.  Thank you both for pointing me in right directions smile

Clemmitt

Offline

#6 2015-10-13 15:18:11

dishaze
Member
From: Quebec
Registered: 2014-02-01
Posts: 6

Re: [Solved, deprecated upstream] who -m and w don't show pty logins

Using lxdm here. View changes for packages vte & vte-common:

vte:
-      --enable-introspection --with-gtk=2.0
+      --enable-introspection --with-gtk=2.0 --disable-gnome-pty-helper

vte-common:
-      --enable-introspection --enable-gnome-pty-helper
+      --enable-introspection

I may be wrong but to me it seems like the disabling of gnome-pty-helper caused this...

Offline

#7 2015-10-13 15:40:08

dishaze
Member
From: Quebec
Registered: 2014-02-01
Posts: 6

Re: [Solved, deprecated upstream] who -m and w don't show pty logins

Don't know about gnome-terminal... but both require vte-common which I believe used to provide gnome-pty-helper.

Offline

#8 2015-10-13 15:42:01

cmsigler
Member
Registered: 2013-11-18
Posts: 35

Re: [Solved, deprecated upstream] who -m and w don't show pty logins

dishaze wrote:

View changes for packages vte & vte-common:

vte:
-      --enable-introspection --with-gtk=2.0
+      --enable-introspection --with-gtk=2.0 --disable-gnome-pty-helper

vte-common:
-      --enable-introspection --enable-gnome-pty-helper
+      --enable-introspection

OK, dumb me.  I was wondering why I had no executable gnome-pty-helper on my system, didn't realize it was missing.

I'll file a bug.  Thank you again for figuring this out!

Clemmitt

Offline

#9 2015-10-13 16:02:58

cmsigler
Member
Registered: 2013-11-18
Posts: 35

Re: [Solved, deprecated upstream] who -m and w don't show pty logins

FS#46695

Clemmitt

Offline

#10 2015-10-13 16:13:01

dishaze
Member
From: Quebec
Registered: 2014-02-01
Posts: 6

Re: [Solved, deprecated upstream] who -m and w don't show pty logins

What do you means by "...as a login session." in that bug report?
If you meant the same as the "Run command as login shell." option in xfce4-terminal, why?
I have this disabled in preferences with "Update utmp/wtmp records" enabled.

Offline

#11 2015-10-13 16:33:17

cmsigler
Member
Registered: 2013-11-18
Posts: 35

Re: [Solved, deprecated upstream] who -m and w don't show pty logins

dishaze wrote:

If you meant the same as the "Run command as login shell."
option in xfce4-terminal, why? I have this disabled in preferences with
"Update utmp/wtmp records" enabled.

I honestly never looked into why I checked both these options, but they're both checked.
So the answer to your question is "I don't know." big_smile

Unchecking "Run command as login shell" and leaving "Update utmp/wtmp records"
checked didn't solve this.  Then the bash shell isn't a login shell so it doesn't source my
.bash_profile and related.  Checking "Run command as login shell" and unchecking "Update
utmp/wtmp records" didn't solve this.

Perhaps they do two different things???  "Login shell" sources .bash_profile, etc., while
"Update utmp/wtmp" is supposed to call gnome-pty-helper.  Thank you for more feedback
and all your help.

Clemmitt

Offline

#12 2015-10-13 16:42:23

dishaze
Member
From: Quebec
Registered: 2014-02-01
Posts: 6

Re: [Solved, deprecated upstream] who -m and w don't show pty logins

Oh, that explains why my .bash_profile was never sourced!  <o.O>
Thanks, lol.

Offline

#13 2015-10-13 16:51:26

cmsigler
Member
Registered: 2013-11-18
Posts: 35

Re: [Solved, deprecated upstream] who -m and w don't show pty logins

Reply to the bug report is that the change is intentional and will not be reverted.  Upstream vte is removing
all code for this as they don't see the need, and it is installed as a setuid binary anyway.

If vte removes the code upstream I suppose the only way to keep the functionality is to backward-maintain
that small portion used for gnome-pty-terminal, which seems like a mess for a user to do privately just for
their own satisfaction, and with potential security problems.

If anyone else following this has a good idea on how to maintain pty login recording, please post it here smile
And thanks to all.

Clemmitt

Offline

#14 2015-10-13 17:50:52

cmsigler
Member
Registered: 2013-11-18
Posts: 35

Re: [Solved, deprecated upstream] who -m and w don't show pty logins

Bug report followup from Jan de Groot.  Upstream deprecated here:

https://bugzilla.gnome.org/show_bug.cgi?id=747046

It would seem that the venerable utmp/wtmp are starting on their way out.  Which is a shame.
From FreeBSD utmp(5) man page:

A utmp and wtmp file format appeared in Version 6 AT&T UNIX.

I like systemd and friends.  I don't like the roots of UNIX being deprecated.  Mixed message, eh?

Clemmitt

Offline

Board footer

Powered by FluxBB