You are not logged in.

#1 2018-06-07 16:57:23

inserct
Member
Registered: 2018-06-07
Posts: 15

No pts/ output from 'w', 'who' commands

Hello!

I'm using "w" command in .bashrc and it was working well. Thats not the problem. The real problem was a cople days ago when i noticed it only prompts tty sessions, no pts.

I've reading the forum searching for a possible solution, because there was some explanations with this topic, i mean, i've read this https://bbs.archlinux.org/viewtopic.php?id=236423 topic exactly. The solution they offer was doing a fresh installation and i prefer obivate this, searching for a real solution.

I've read this too https://bugs.archlinux.org/task/19392 and definitely seems a bug, but the report comes from 8 years ago, don't know if it is a different bug (probably i think). I've read some other possible solutions via google, and nothing seems to work for me.

Here paste some of my prompts:

# w
17:51:33 up 10 min,  1 user,  load average: 0,64, 0,44, 0,23
USER        TTY    LOGIN@   IDLE   JCPU     PCPU    WHAT
<my-user>   tty1   17:41    10:10  15.81s   0.01s  /bin/sh /usr/bin/startkde

# who
<my-user>   tty1   2018-06-07 17:41 (:0)

# last | grep pts
... etcetera
<my-user>    pts/2    :0    Wed May 30 16:17 - 16:17  (00:00)
<my-user>    pts/1    :0    Wed May 30 16:16 - 16:17  (00:00)
<my-user>    pts/0    :0    Wed May 30 16:12 - 18:40  (02:28)
<my-user>    pts/0    :0    Wed May 30 16:12 - 16:12  (00:00)
<my-user>    pts/2    :0    Wed May 30 16:11 - 16:16  (00:04)
<my-user>    pts/1    :0    Wed May 30 16:11 - 16:12  (00:00)
<my-user>    pts/1    :0    Wed May 30 16:07 - 16:08  (00:00)
... etcetera

# ps
PID     TTY      TIME       CMD
4136    pts/0    00:00:00   bash
4928    pts/0    00:00:00   ps

# getent group utmp
utmp:x:20:

** Dont know if it was "utmp:x:966:". Supposed by:  (in relation to https://bbs.archlinux.org/viewtopic.php?id=236423 possible diagnostics)

# ls -l /var/run/utmp
-rw-rw-r-- 1 root 966 768 jun  7 17:05 /var/run/utmp

I've tried to change "by hand" the GID of utmp from 20 to 966 with no result.

By the other hand, i've considered the possibility it really is a bug, and the way to solve it. Checking the permissions of the terminal emulators (konsole in my case) and utmp (wich is not recording PTS info but works recording on TTY)

This is my output:

# ls -l /var/run/utmp
# ls -l /usr/bin/xterm
# ls -l /usr/bin/konsole

returns (respectively)

-rw-rw-r-- 1 root 966 768 jun  7 17:05 /var/run/utmp
-rwxr-xr-x 1 root root 721496 may  4 07:40 /usr/bin/xterm
-rwxr-xr-x 1 root root 5896 may  8 14:14 /usr/bin/konsole

So... i decided changing permssions (with the bug report explanation) to this

-rw-rw-r-- 1 root utmp 768 jun  7 17:33 /var/run/utmp
-rwxr-xr-x 1 root utmp 721496 may  4 07:40 /usr/bin/xterm
-rwxr-xr-x 1 root utmp 5896 may  8 14:14 /usr/bin/konsole

It doesn't work at all... Perhaps is a silly mistake from my part, don't know but after all, i have no any solution neither more info to apply...
Thanks in advance!

Offline

#2 2018-06-07 17:10:05

loqs
Member
Registered: 2014-03-06
Posts: 17,326

Re: No pts/ output from 'w', 'who' commands

Welcome to the arch linux forums inserct.  The permission changes you made will be overwritten by systemd tmpfiles on next boot.
What is the output of

getent group utmp #to check it is still 20
ls -la /usr/lib/utempter/utempter

Offline

#3 2018-06-07 17:15:20

inserct
Member
Registered: 2018-06-07
Posts: 15

Re: No pts/ output from 'w', 'who' commands

Hi loqs! I've reading you in the post i mencioned, thanks for your welcoming! wink

I've checked the group and it is still 20, no problem with that.

This is my prompt:

# ls -la /usr/lib/utempter/utempter
-rwxr-sr-x 1 root 9,8K jun  4 15:56 /usr/lib/utempter/utempter

Last edited by inserct (2018-06-07 18:06:39)

Offline

#4 2018-06-07 17:19:15

loqs
Member
Registered: 2014-03-06
Posts: 17,326

Re: No pts/ output from 'w', 'who' commands

Please try

chown root:utmp /usr/lib/utempter/utempter

Then restart xterm or konsole and see if the new session is registered.

Offline

#5 2018-06-07 17:26:33

inserct
Member
Registered: 2018-06-07
Posts: 15

Re: No pts/ output from 'w', 'who' commands

Okay, nothing seems to work...

# chown root:utmp /usr/lib/utempter/utempter
# ls -l /usr/lib/utempter/utempter
-rwxr-xr-x 1 root 9,8K jun  4 15:56 /usr/lib/utempter/utempter

Only persmission have changed but no difference at output...

Offline

#6 2018-06-07 17:31:15

loqs
Member
Registered: 2014-03-06
Posts: 17,326

Re: No pts/ output from 'w', 'who' commands

-rwxr-xr-x 1 root 9,8K jun  4 15:56 /usr/lib/utempter/utempter

Is ls configured on your system not to show the group?
What xterminal programs are you using?

Offline

#7 2018-06-07 17:33:14

inserct
Member
Registered: 2018-06-07
Posts: 15

Re: No pts/ output from 'w', 'who' commands

Yes, sorry, i forgot i've an alias, with unalias now:

# ls -l /usr/lib/utempter/utempter
-rwxr-xr-x 1 root utmp 9992 jun  4 15:56 /usr/lib/utempter/utempter

Offline

#8 2018-06-07 17:35:05

inserct
Member
Registered: 2018-06-07
Posts: 15

Re: No pts/ output from 'w', 'who' commands

and using Konsole, with basic configuration of my own profile, not playing with this software, nothing extrange

Offline

#9 2018-06-07 19:03:11

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: No pts/ output from 'w', 'who' commands

Run an xterm - do you get the pts entry now?
Also try

strace konsole 2>&1 | grep -iE '(utmp|utemp)'

to see whether libutempter.so.0 is opened or maybe /usr/lib/utempter/utempter is or you get failures

Offline

#10 2018-06-07 20:34:39

inserct
Member
Registered: 2018-06-07
Posts: 15

Re: No pts/ output from 'w', 'who' commands

Nothing seems to be wrong...

From xterm:

strace konsole 2>&1 | grep -iE '(utmp|utemp)'

In fact, it opens a new instance for Konsole and keep listening...

From Konsole instance [ empty ]:
- Try commands forcing output error / messages

# w
22:28:07 up  3:07,  1 user,  load average: 0,38, 0,38, 0,48
USER        TTY    LOGIN@   IDLE   JCPU     PCPU    WHAT
<my-user>   tty1   22:21    3:07m  14:33    0.01s   /bin/sh /usr/bin/startkde

# who
<my-user>   tty1   2018-06-07 22:21 (:0)

Xterm while listening, does not move. I think everything is OK and loaded...

I'll continue with this little problem, for sure, if success or find anything, I'll post it, thank you for give me your help too, seth!

Last edited by inserct (2018-06-07 20:39:53)

Offline

#11 2018-06-07 20:40:39

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: No pts/ output from 'w', 'who' commands

No, the idea was to check whether the strace/grep would reveal konsole trying to access utempter - that does not seem to be the case?
Eg. strace/grepping xterm would (should) print:

openat(AT_FDCWD, "/usr/lib/libutempter.so.0", O_RDONLY|O_CLOEXEC) = 3

but the xterm instance also gets me

seth     pts/2     22:39    0.00 s  0.30 s  0.01 s w

Offline

#12 2018-06-07 20:52:25

inserct
Member
Registered: 2018-06-07
Posts: 15

Re: No pts/ output from 'w', 'who' commands

Okay, so... xterm doesn't print anything... it keeps blank but 'freezed', listening... if close the instance of konsole, xterm give me back to the 'normal' empty prompt...

Offline

#13 2018-06-07 20:59:05

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: No pts/ output from 'w', 'who' commands

It's not "listening". strace traces system calls of the invoked process (and if you remove the grep filter, it will print A LOT)
So konsole doesn't attempt to update utmp…

To test the basic utmp functionality, try

xterm -ut
xterm +ut

and for each xterm run "w" to see whether there's a PTS entry (expectable for "+ut", not so much for "-ut")

Offline

#14 2018-06-07 21:00:09

inserct
Member
Registered: 2018-06-07
Posts: 15

Re: No pts/ output from 'w', 'who' commands

Tried the next step...

in Xterm:

# strace konsole 2>&1&>> strace.txt

So, without grepping, it gives me ALL the trace, and try to find in it manually 'utmp' and 'utemp' ... nothing founded...

Offline

#15 2018-06-07 21:01:44

inserct
Member
Registered: 2018-06-07
Posts: 15

Re: No pts/ output from 'w', 'who' commands

Okay, sorry for my languaje, you're right... i've checked the utmp file and your're right, konsole does not write anything... (was writting the other entry when you answer me)

Last edited by inserct (2018-06-07 21:02:21)

Offline

#16 2018-06-07 21:04:24

inserct
Member
Registered: 2018-06-07
Posts: 15

Re: No pts/ output from 'w', 'who' commands

Both prints the same,

xterm: cannot load font "-Misc-Fixed-medium-R-*-*-13-120-75-75-C-120-ISO10646-1"
xterm: cannot load font "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1"

when 'w', 'who' on xterm, it gives me back the same message... my login on tty, nothing for pts

# w
22:28:07 up  3:07,  1 user,  load average: 0,38, 0,38, 0,48
USER        TTY    LOGIN@   IDLE   JCPU     PCPU    WHAT
<my-user>   tty1   22:21    3:07m  14:33    0.01s   /bin/sh /usr/bin/startkde

# who
<my-user>   tty1   2018-06-07 22:21 (:0)

Last edited by inserct (2018-06-07 21:10:20)

Offline

#17 2018-06-07 21:08:43

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: No pts/ output from 'w', 'who' commands

https://www.archlinux.org/packages/extr … onts-misc/

But that's not relevant. The question is whether one of those xterms will create a utmp entry (ie. an additional login in "w")

Offline

#18 2018-06-07 21:11:24

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: No pts/ output from 'w', 'who' commands

pacman -Qkk libutempter
strace xterm 2>&1 | grep -iE '(utmp|utemp)'

Offline

#19 2018-06-07 21:22:41

inserct
Member
Registered: 2018-06-07
Posts: 15

Re: No pts/ output from 'w', 'who' commands

Okay, there is something here!

# pacman -Qkk libutempter
warning: libutempter: /usr/lib/utempter/utempter (The group identifier -GID- does not match)
warning: libutempter: /usr/lib/utempter/utempter (The permissions do not match)
libutempter: 18 total files, 1 file modified

**Sorry if the traslation is not perfect, my sistem is not in english :S

Last edited by inserct (2018-06-07 21:44:22)

Offline

#20 2018-06-07 21:25:06

inserct
Member
Registered: 2018-06-07
Posts: 15

Re: No pts/ output from 'w', 'who' commands

maybe this is an answer? https://bugs.archlinux.org/task/58306

# cd /usr/lib/utempter
# ls -l
-rwxr-sr-x 1 root systemd-coredump 9992 jun  4 15:56 utempter

systemd-coredump gid is 996, NOT 20.

if gid of utempter does not match with gid of utmp, xterm and konsole does not print pts/* login ...
Gonna make some proofs and i'll back to give the solution (i hope)

Last edited by inserct (2018-06-07 21:43:52)

Offline

#21 2018-06-07 22:37:31

loqs
Member
Registered: 2014-03-06
Posts: 17,326

Re: No pts/ output from 'w', 'who' commands

What changed since post #7?

Offline

#22 2018-06-08 02:47:02

inserct
Member
Registered: 2018-06-07
Posts: 15

Re: No pts/ output from 'w', 'who' commands

- Checked utmp file ownership, it is as it must to be (root:utmp)
- Checking /usr/lib/utempter/utempter ownership

# ls -l
-rwxr-sr-x 1 root systemd-coredump 9992 jun  4 15:56 utempter
seth wrote:
pacman -Qkk libutempter

That returns to me

# pacman -Qkk libutempter
warning: libutempter: /usr/lib/utempter/utempter (The group identifier -GID- does not match)
warning: libutempter: /usr/lib/utempter/utempter (The permissions do not match)
libutempter: 18 total files, 1 file modified

So, utmp, has a gid equal to 20, utempter has a gid equal to 996 (viewed at /etc/group file), they must to be equal one another...
if not, libutempter loses the capability for writting in utmp. Making some testings with the aid of Seth i've noticed that in fact, utmp file is empty of any record for pts login.

Looking out the topic for more info to solve, i've found this https://bugs.archlinux.org/task/58306 (and see you read that and comment too) explaining why libutempter loses the mencioned capability of writting. It can be solved, in the way libutempter requires /usr/lib/utempter/utempter to be owned by root:utmp... that's the target, but my skills are limited, i want to find the way to do it but have to learn a bit more to really understand how can i solve it successfully. In the other hand, i was searching for some update or something similar (because it was working well, until it stopped, obviously, and i didn't modified any permissions of any file) to find the point that permission was modified and why...

Thats the reason of my last answer... simply i think i'm on the correct way, but don't know how to change that permission for writting umtp... maybe i misunderstood something i've to learn... :S so, i'll find the solution, althought it'll be tricky...

Thanks for asking!

Last edited by inserct (2018-06-08 02:48:12)

Offline

#23 2018-06-24 13:25:16

kifuna
Member
Registered: 2015-01-29
Posts: 39

Re: No pts/ output from 'w', 'who' commands

I had the same issue (GID of utmp not being 966). As I understand there are basically two options, either changing the GID of utmp to 966 or changing the ownership and permissions of /usr/lib/utempter/utempter. The first is not an option for me, since on my different machines 966 is either unused or already corresponds to sddm or avahi and I did not want to change those too. The assignment of 966 is unpredictable, in your case it, e.g., corresponds to systemd-coredump.

However, simply executing

# chown root:utmp /usr/lib/utempter/utempter

does not suffice as this also changes the permissions as seen from the two warnings in the output of

pacman -Qkk libutempter

in your post. Hence, one also has to set the permissions accordingly via

# chmod g+s /usr/lib/utempter/utempter

Then pacman only reports the changed GID, as expected:

pacman -Qkk libutempter
warning: libutempter: /usr/lib/utempter/utempter (GID mismatch)
libutempter: 18 total files, 1 altered file

The problem stems from /usr/lib/utempter/utempter being installed by libutempter with ownership root:20 until version 1.1.6-2 but with ownership root:966 in version 1.1.6-3 (released on 2018-06-04). Whereas the former GID of utmp was predictable on any Arch installation, the latter isn't (see https://bbs.archlinux.org/viewtopic.php?id=236423 and https://bugs.archlinux.org/task/58306).

Last edited by kifuna (2018-06-24 13:28:50)

Offline

Board footer

Powered by FluxBB