"last" shows that tty2 crashes everytime I shutdown or reboot my pc

Hello. I am using Tumbleweed KDE. When I did last command I saw that tty2 crashes every time I shutdown my pc. Why is that happening?

tty2         :0               Mon May 19 03:48 - crash 
reboot   system boot  6.14.6-1-default Mon May 19 03:46 - 10:20  (06:33)
tty2         :0               Sat May  3 17:59 - crash 
reboot   system boot  6.14.4-1-default Sat May  3 17:57 - 19:06  (01:08)
tty2         :0               Sat May  3 02:07 - crash 
reboot   system boot  6.14.4-1-default Sat May  3 02:07 - 02:48  (00:41)

Please also show your prompt + command.

Did not understand what do you mean by that, sorry.
You mean like that?

[I] [06:35:10] username@localhost /home/username
> last

I meant the command the generated the output you showed in your original post

OK, I see that too, but no idea what these lines mean

I do not see this line on the Tumbleweed with KDE/Wayland. Find out what process creates it (it looks rather strange anyway, the first field is supposed to be a user name).

$ last
marel    tty2         :0               Sun May 25 10:29 - still logged in
reboot   system boot  6.14.6-1-default Sun May 25 09:28 - still running
marel    tty2         :0               Sat May 24 08:49 - crash 
reboot   system boot  6.14.6-1-default Sat May 24 08:48 - 23:50  (17:01)
marel    tty2         :0               Fri May 23 19:34 - crash 
reboot   system boot  6.14.6-1-default Fri May 23 19:33 - 23:52  (04:19)
marel                                  Fri May 23 09:05 - crash 
marel                                  Fri May 23 09:01 - crash 
marel    tty2         :0               Fri May 23 08:38 - crash 
reboot   system boot  6.14.6-1-default Fri May 23 08:37 - 08:55  (01:17)

So what I see:

  • When the computer is switched on I see saying reboot system boot
  • One minute later I see tty2 :0 <timestamp> - crash, that is likely some process (grud/sddm) being terminated after boot.
  • A shutdown is not getting logged

man last gives:

wtmpdb last goes through the /var/lib/wtmpdb/wtmp.db database (or the database designated by the -f option) and displays a list of of all users logged in and logged out.

So it looks like that with a shutdown there is no formal log out.

crash simply means that there was no matching logout record. Which is quite possible on reboot.

It is logged, it is just that last displays combined results of two records - boot and shutdown.

records…

$ sqlite3 /var/lib/wtmpdb/wtmp.db
sqlite> .tables
wtmp
sqlite> .headers on
sqlite> .width auto
sqlite> .mode column
sqlite> SELECT * FROM wtmp ORDER BY ID DESC LIMIT 9;
ID    Type  User    Login             Logout            TTY   RemoteHost        Service       
----  ----  ------  ----------------  ----------------  ----  ----------------  --------------
1660  3     marel   1748150954291067                    tty2  :0                sddm-autologin
1659  1     reboot  1748150935747118                    ~     6.14.6-1-default                
1658  3     marel   1748062180691719                    tty2  :0                sddm-autologin
1657  1     reboot  1748062121747382  1748123420223578  ~     6.14.6-1-default                
1656  3     marel   1748021646649882                    tty2  :0                sddm-autologin
1655  1     reboot  1748021625747204  1748037173386667  ~     6.14.6-1-default                
1654  3     marel   1747980345474920                                            login         
1653  3     marel   1747980063721283                                            login         
1652  3     marel   1747978695477502                    tty2  :0                sddm-autologin

So yes, it is sddm-autologin that “crashes”, could it be:

sudo journalctl -b -g SIGRTMIN
May 25 09:28:57 systemd[1]: Received SIGRTMIN+20 from PID 421 (plymouthd).
May 25 09:29:11 systemd[1]: Received SIGRTMIN+20 from PID 421 (plymouthd).
May 25 09:29:12 systemd[1]: Received SIGRTMIN+21 from PID 421 (plymouthd).
May 25 09:29:12 systemd[1]: Received SIGRTMIN+21 from PID 421 (plymouthd).

BTW that is different from what OP showed.

Once more - it does not crash. Stop confusing everyone. It did not write logout record. It could be because it crashed, but most likely - because on shutdown there is no logout, user session is just terminated. Just try to actually log out and shutdown from the SDDM greeter.

No, it could not. Read man systemd what SIGRTMIN+20 means.

1 Like

It looks to me the same apart the the OP removed the user name from the begin of the line.

Your right that also calling it “cat” makes people think of a cat; indeed SIGRTMIN+20 does not have anything to do with this.

I do see a sddm-helper process running long after the start of the computer:

$ ps axjf
S        0   0:00  \_ /usr/libexec/sddm/sddm-helper --socket /tmp/sddm-auth-1dfed4a7-9af4-4a2c-a573-067e236e5745 --id 1 --start /usr/bin/startplasma-x11 --user marel --autologin
Sl    1000   0:00      \_ /usr/bin/startplasma-x11
Ss    1000   0:00          \_ /usr/bin/ssh-agent /usr/bin/gpg-agent --sh --daemon --keep-display /usr/libexec/xinit/xinitrc
Ssl   1000   0:00          \_ /usr/bin/gpg-agent --sh --daemon --keep-display /usr/libexec/xinit/xinitrc

So is it this process that does not properly log out?

Of course. sddm-helper is responsible for launching user session and it remains for as long as this session is active.

Yes, it is. It does not even get chance to log out when user initiates shutdown.

And how are we supposed to guess it? Garbage in - garbage out.

Seems no one is too concerned about that GitHub ticket, that’s been sitting “Open” for almost three years.

Thought I’d toss in my output of everyone’s various commands, for comparison
…

myuser@machine:~> last
myuser   pts/1        :0               Sun May 25 09:48   still logged in
myuser   pts/0        :0               Sun May 25 09:48   still logged in
myuser   tty2         :0               Sun May 25 09:48   still logged in
reboot   system boot  6.4.0-150600.23. Sun May 25 09:47   still running
myuser   pts/0        :0               Sat May 24 10:30 - 11:15  (00:44)
myuser   tty2         :0               Sat May 24 10:30 - down   (00:44)
reboot   system boot  6.4.0-150600.23. Sat May 24 10:30 - 11:15  (00:45)
myuser   pts/1        :0               Sat May 24 10:21 - 10:27  (00:05)
myuser   pts/0        :0               Wed May 21 17:23 - 10:27 (2+17:04)
myuser   tty2         :0               Wed May 21 17:22 - down  (2+17:04)
reboot   system boot  6.4.0-150600.23. Wed May 21 17:22 - 10:27 (2+17:04)
myuser   pts/0        :0               Wed May 21 09:00 - 09:27  (00:27)
myuser   tty2         :0               Wed May 21 09:00 - down   (00:27)
reboot   system boot  6.4.0-150600.23. Wed May 21 08:59 - 09:27  (00:27)
[...]

myuser@machine:~> ps axjf
 PPID   PID  PGID   SID TTY      TPGID STAT   UID   TIME COMMAND
[...]
    1  1530  1529  1529 ?           -1 S      490   0:00 /usr/sbin/chronyd
    1  1582  1554  1554 ?           -1 Sl       0   0:00 /usr/bin/sddm
 1582  1587  1587  1587 tty2      1587 Ssl+     0   0:15  \_ /usr/bin/X -nolisten tcp -background none -seat seat0 vt2 -auth /run/sddm/xauth_IZ -noreset -displayfd 16
 1582  1791  1554  1554 ?           -1 S        0   0:00  \_ /usr/lib/sddm/sddm-helper --socket /tmp/sddm-auth-0b316450 --id 1 --start /usr/bin/startplasma-x11 --user myuser
 1791  1812  1554  1554 ?           -1 Sl    1000   0:00      \_ /usr/bin/startplasma-x11
 1812  1861  1861  1861 ?           -1 Ss    1000   0:00          \_ /usr/bin/gpg-agent --sh --daemon --keep-display /etc/X11/xinit/xinitrc
[...]
    1  1680  1680  1680 ?           -1 Ss       0   0:00 /usr/lib/postfix/bin//master -w
 1680  1681  1680  1680 ?           -1 S       51   0:00  \_ pickup -l -t fifo -u
 1680  1682  1680  1680 ?           -1 S       51   0:00  \_ qmgr -l -t fifo -u
[...]
.
machine:~ #  journalctl -b -g SIGRTMIN
-- No entries --
machine:~ #

1 Like

Appreciated, no unterminated sessions, are you maybe running systemd-boot?

  1. What makes you think this ticket is related to this topic?
  2. What makes you think it is SDDM problem to start with?

GNOME+gdm:

bor@tw:~> last
bor      tty2                          Mon May 26 07:11 - still logged in
reboot   system boot  6.14.6-9.gce99fa Mon May 26 07:09 - still running
bor                                    Sun May 18 08:30 - crash 
bor                                    Sun May 18 08:30 - crash 
bor      pts/0        UNKNOWN          Sun May 18 07:38 - 08:42  (01:03)
bor      pts/0        UNKNOWN          Sun May 18 07:29 - 07:36  (00:06)
root     tty1                          Sat May 17 10:22 - 10:22  (00:00)
bor      tty2                          Sat May 17 10:12 - crash 
reboot   system boot  6.14.6-9.gce99fa Sat May 17 10:11 - 10:20  (00:08)
bor      tty2                          Sat May 17 07:12 - crash 
reboot   system boot  6.14.6-8.gce99fa Sat May 17 07:11 - 10:11  (03:00)

Once more - there is no desktop logout sequence when system is going to shutdown. Period. Sometimes you may be lucky and your session has chance to terminate (like SSH sessions, UNKNOWN is due to VSOCK, or terminal session).

How the ticket is related is that I think that if sddm-helper was properly terminated after log out the session would be properly ended. But to be honest I do not know the details here likely sddm-helper is not responsible for updating the wtmpdb at log out.

Searching further I see:

https://unix.stackexchange.com/questions/715630/missing-shutdown-entries-in-wtmp-despite-graceful-reboots

Based on that it looks more like a systemd dependency problem.

Playing with cockpit Services I found the systemd unit that should update the should write the shutdown time:

> sudo systemctl cat wtmpdb-update-boot
# /usr/lib/systemd/system/wtmpdb-update-boot.service
[Unit]
Description=Write boot and shutdown times into wtmpdb
Documentation=man:wtmpdb(8)
DefaultDependencies=no
RequiresMountsFor=/var/lib/wtmpdb
Conflicts=shutdown.target
After=systemd-remount-fs.service systemd-tmpfiles-setup.service
Before=shutdown.target
# Ask for the dbus socket.
Wants=dbus.socket
After=dbus.socket

[Service]
Type=oneshot
ExecStart=/usr/bin/wtmpdb boot
ExecStop=/usr/bin/wtmpdb shutdown
RemainAfterExit=true

[Install]
WantedBy=default.target

So I guess now the question is why it is not run on shutdown.

Your own posts clearly show that it is run on shutdown:

Indeed it looks like for every computer session two “user sessions” are started, one that is properly ended on shutdown and one, the sddm-helper session not. If I issue w I see (only) the sddm-helper session:

$ w
 21:37:22 up 43 min,  1 user,  load average: 0.47, 0.62, 0.61
USER     TTY   FROM  LOGIN@   IDLE   JCPU   PCPU  WHAT
marel    tty2  -     20:54   43:02   1:45   0.01s /usr/libexec/sddm/sddm-helper --socket /tmp/sddm-auth-<snip> --id 1 --start /usr/bin/startplasma-x11 --user marel --autologin

Another “throw this out there” for examination.

Here’s what I did. Powered up the machine. At the login screen, I did a CTRL-ALT-F1, then logged in as the root user, then executed the “ps axjf”. Then I logged out of that F1 Console session …

Then (at GUI login screen) logged in as my regular user account.
Next, I logged out of my regular user account (the KDE Plasma environment)

Then, back at the login screen, I repeated the CTRL-ALT-F1, logged in as the root user, then executed the “ps axjf” again … here’s the cat’ed output:

before the user login
 PPID   PID  PGID   SID TTY      TPGID STAT   UID   TIME COMMAND
    1  1602  1571  1571 ?           -1 Sl       0   0:00 /usr/bin/sddm
 1602  1610  1610  1610 tty2      1610 Ssl+     0   0:00  \_ /usr/bin/X -nolisten tcp -background none -seat seat0 vt2 -auth /run/sddm/xauth_usmQFu -noreset -displayfd 16
 1602  1740  1571  1571 ?           -1 S        0   0:00  \_ /usr/lib/sddm/sddm-helper --socket /tmp/sddm-auth-7ed7248c-c750-4e65-abe2-6f801883db68 --id 2 --start /usr/bin/sddm-greeter --socket /tmp/sddm-:0-BNreye --theme /usr/share/sddm/themes/breeze-openSUSE --user sddm --greeter
 1740  1756  1571  1571 ?           -1 Sl     461   0:01      \_ /usr/bin/sddm-greeter --socket /tmp/sddm-:0-BNreye --theme /usr/share/sddm/themes/breeze-openSUSE
    1  1701  1701  1701 ?           -1 Ss       0   0:00 /usr/lib/postfix/bin//master -w
    
after user logs out, back at GUI login screen
 PPID   PID  PGID   SID TTY      TPGID STAT   UID   TIME COMMAND
    1  1602  1571  1571 ?           -1 Sl       0   0:00 /usr/bin/sddm
 1602  2998  2998  2998 tty2      2998 Ssl+     0   0:00  \_ /usr/bin/X -nolisten tcp -background none -seat seat0 vt2 -auth /run/sddm/xauth_DCkJBg -noreset -displayfd 18
 1602  3153  1571  1571 ?           -1 S        0   0:00  \_ /usr/lib/sddm/sddm-helper --socket /tmp/sddm-auth-7ed7248c-c750-4e65-abe2-6f801883db68 --id 4 --start /usr/bin/sddm-greeter --socket /tmp/sddm-:0-Yjouss --theme /usr/share/sddm/themes/breeze-openSUSE --user sddm --greeter
 3153  3168  1571  1571 ?           -1 Sl     461   0:01      \_ /usr/bin/sddm-greeter --socket /tmp/sddm-:0-Yjouss --theme /usr/share/sddm/themes/breeze-openSUSE
    1  1701  1701  1701 ?           -1 Ss       0   0:00 /usr/lib/postfix/bin//master -w