Random log out after inactivity

I’ve been having an issue where I will come back to my desktop after a random bit of time and find instead of unlocking the screen, it shows me the splashscreen animation from a new log in. Sometimes it’s a few hours, other times it is a few days.

I’m pretty sure that what I need to find is in the Journald log, but I am not sure what to look for. I saved the log from KSystemlog as a text file and look for “logout” and similar words, but I am not finding anything.

What output should I look for to find out when a desktop session ends?

Hi @marriedman,

The command you’re looking for is:

journalctl --boot=-1 --priority=4 --no-pager

Where:

  • The --boot=-1 parameter is the computer’s boot this happened on. So -1 for the previous boot, -2 for the one before that, -3 for the one before that, and so on, and so forth. Feel free to adjust it as neccessary;
  • the --priority= argument limits the output to errors and warnings only;
  • the --no-pager argument formats the output nicely so that you can post it easily here, on the forum. It can also be omitted if you wish.

More information:

https://wiki.archlinux.org/title/Systemd/Journal

Hope you manage!

1 Like

Thanks @Mirdarthos - I knew I was in the right area, that command really whittled it down. I think I may have found the issue:

    ~  journalctl --boot=-1 --priority=4 --no-pager                            ✔ 
Apr 14 03:04:03 littlemofo kernel: x86/cpu: SGX disabled by BIOS.
Apr 14 03:04:03 littlemofo kernel: ENERGY_PERF_BIAS: Set to 'normal', was 'performance'
Apr 14 03:04:03 littlemofo systemd[1]: Configuration file /etc/systemd/system/piavpn.service is marked executable. Please remove executable permission bits. Proceeding anyway.
Apr 14 03:04:03 littlemofo systemd-udevd[288]: /etc/udev/rules.d/40-libsane.rules:26: GOTO="libsane_rules_end" has no matching label, ignoring
Apr 14 03:04:03 littlemofo systemd-journald[287]: File /var/log/journal/ea294a3f84ff4124b59baf47f093e2d9/system.journal corrupted or uncleanly shut down, renaming and replacing.
Apr 14 03:04:03 littlemofo systemd-udevd[288]: /etc/udev/rules.d/S99-2000S1.rules:26: GOTO="libsane_rules_end" has no matching label, ignoring
Apr 14 03:04:04 littlemofo kernel: thermal thermal_zone1: failed to read out thermal zone (-61)
**Apr 14 03:04:04 littlemofo kernel: WARNING! power/level is deprecated; use power/control instead**
Apr 14 03:04:04 littlemofo bluetoothd[437]: profiles/audio/vcp.c:vcp_init() D-Bus experimental not enabled
Apr 14 03:04:04 littlemofo bluetoothd[437]: src/plugin.c:plugin_init() Failed to init vcp plugin
Apr 14 03:04:04 littlemofo bluetoothd[437]: profiles/audio/mcp.c:mcp_init() D-Bus experimental not enabled
Apr 14 03:04:04 littlemofo bluetoothd[437]: src/plugin.c:plugin_init() Failed to init mcp plugin
Apr 14 03:04:04 littlemofo bluetoothd[437]: profiles/audio/bap.c:bap_init() D-Bus experimental not enabled
Apr 14 03:04:04 littlemofo bluetoothd[437]: src/plugin.c:plugin_init() Failed to init bap plugin
Apr 14 03:04:05 littlemofo kernel: skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Parent card not yet available, widget card binding deferred
Apr 14 03:04:05 littlemofo kernel: snd_hda_codec_realtek ehdaudio0D0: ASoC: sink widget AIF1TX overwritten
Apr 14 03:04:05 littlemofo kernel: snd_hda_codec_realtek ehdaudio0D0: ASoC: source widget AIF1RX overwritten
Apr 14 03:04:05 littlemofo kernel: skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi3 overwritten
Apr 14 03:04:05 littlemofo kernel: skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi2 overwritten
Apr 14 03:04:05 littlemofo kernel: skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi1 overwritten
Apr 14 03:04:05 littlemofo kernel: skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Codec Output Pin1 overwritten
Apr 14 03:04:05 littlemofo kernel: skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Codec Input Pin1 overwritten
Apr 14 03:04:05 littlemofo kernel: skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Analog Codec Playback overwritten
Apr 14 03:04:05 littlemofo kernel: skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Digital Codec Playback overwritten
Apr 14 03:04:05 littlemofo kernel: skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Alt Analog Codec Playback overwritten
Apr 14 03:04:05 littlemofo kernel: skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Analog Codec Capture overwritten
Apr 14 03:04:05 littlemofo kernel: skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Digital Codec Capture overwritten
Apr 14 03:04:05 littlemofo kernel: skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Alt Analog Codec Capture overwritten
Apr 14 03:04:05 littlemofo kernel: kauditd_printk_skb: 31 callbacks suppressed
Apr 14 03:04:06 littlemofo systemd[740]: xdg-user-dirs-update.service: Failed with result 'exit-code'.
Apr 14 03:04:06 littlemofo systemd[740]: Failed to start Update XDG user dir configuration.
Apr 14 03:04:06 littlemofo sddm-greeter[824]: QFont::fromString: Invalid description '(empty)'
Apr 14 03:04:07 littlemofo sddm-greeter[824]: QObject: Cannot create children for a parent that is in a different thread.
                                              (Parent is QGuiApplication(0x7ffd558d8420), parent's thread is QThread(0x5651a0933a70), current thread is QThread(0x5651a0a8f820)
Apr 14 03:04:07 littlemofo sddm-greeter[824]: QObject: Cannot create children for a parent that is in a different thread.
                                              (Parent is QGuiApplication(0x7ffd558d8420), parent's thread is QThread(0x5651a0933a70), current thread is QThread(0x5651a0a8f820)
Apr 14 03:04:07 littlemofo sddm-greeter[824]: QObject: Cannot create children for a parent that is in a different thread.
                                              (Parent is QGuiApplication(0x7ffd558d8420), parent's thread is QThread(0x5651a0933a70), current thread is QThread(0x5651a0a8f820)
Apr 14 03:04:07 littlemofo sddm-greeter[824]: QObject::installEventFilter(): Cannot filter events for objects in a different thread.
Apr 14 03:04:07 littlemofo sddm-greeter[824]: file:///usr/share/sddm/themes/breath/components/VirtualKeyboard.qml:11:1: Type InputPanel unavailable
Apr 14 03:04:07 littlemofo sddm-greeter[824]: qrc:/QtQuick/VirtualKeyboard/content/InputPanel.qml:138:5: Type Keyboard unavailable
Apr 14 03:04:07 littlemofo sddm-greeter[824]: qrc:/QtQuick/VirtualKeyboard/content/components/Keyboard.qml:38:1: module "QtQuick.VirtualKeyboard.Plugins" is not installed
Apr 14 03:04:07 littlemofo sddm-greeter[824]: file:///usr/share/sddm/themes/breath/Main.qml:465:13: Unable to assign [undefined] to QUrl
Apr 14 03:04:07 littlemofo sddm-greeter[824]: QDBusConnection: name 'org.freedesktop.UDisks2' had owner '' but we thought it was ':1.20'
Apr 14 03:04:07 littlemofo sddm-greeter[824]: file:///usr/share/sddm/themes/breath/Main.qml:465:13: Unable to assign [undefined] to QUrl
Apr 14 03:04:07 littlemofo sddm-greeter[824]: file:///usr/share/sddm/themes/breath/Main.qml:465:13: Unable to assign [undefined] to QUrl
Apr 14 03:04:07 littlemofo sddm-greeter[824]: file:///usr/share/sddm/themes/breath/Main.qml:465:13: Unable to assign [undefined] to QUrl
Apr 14 03:04:07 littlemofo sddm-greeter[824]: file:///usr/share/sddm/themes/breath/Main.qml:465:13: Unable to assign [undefined] to QUrl
Apr 14 03:04:07 littlemofo sddm-greeter[824]: file:///usr/share/sddm/themes/breath/Main.qml:465:13: Unable to assign [undefined] to QUrl
Apr 14 03:04:07 littlemofo sddm-greeter[824]: file:///usr/share/sddm/themes/breath/Main.qml:465:13: Unable to assign [undefined] to QUrl
Apr 14 03:04:11 littlemofo kernel: kauditd_printk_skb: 1044 callbacks suppressed
Apr 14 03:04:11 littlemofo nmbd[1958]: [2023/04/14 03:04:11.379604,  0] ../../source3/nmbd/nmbd.c:901(main)
Apr 14 03:04:11 littlemofo nmbd[1958]:   nmbd version 4.18.1 started.
Apr 14 03:04:11 littlemofo nmbd[1958]:   Copyright Andrew Tridgell and the Samba Team 1992-2023
Apr 14 03:04:11 littlemofo nmbd[1958]: [2023/04/14 03:04:11.381412,  0] ../../lib/util/become_daemon.c:150(daemon_status)
Apr 14 03:04:11 littlemofo nmbd[1958]:   daemon_status: daemon 'nmbd' : No local IPv4 non-loopback interfaces available, waiting for interface ...
Apr 14 03:04:11 littlemofo nmbd[1958]: [2023/04/14 03:04:11.381531,  0] ../../source3/nmbd/nmbd_subnetdb.c:252(create_subnets)
Apr 14 03:04:11 littlemofo nmbd[1958]:   NOTE: NetBIOS name resolution is not supported for Internet Protocol Version 6 (IPv6).
Apr 14 03:04:35 littlemofo kernel: kauditd_printk_skb: 37 callbacks suppressed
Apr 14 03:05:41 littlemofo systemd[1]: nmb.service: start operation timed out. Terminating.
Apr 14 03:05:41 littlemofo systemd[1]: nmb.service: Failed with result 'timeout'.
Apr 14 03:05:41 littlemofo systemd[1]: Failed to start Samba NMB Daemon.
Apr 14 03:05:41 littlemofo smbd[2167]: [2023/04/14 03:05:41.620764,  0] ../../source3/smbd/server.c:1746(main)
Apr 14 03:05:41 littlemofo smbd[2167]:   smbd version 4.18.1 started.
Apr 14 03:05:41 littlemofo smbd[2167]:   Copyright Andrew Tridgell and the Samba Team 1992-2023

The only thing that jumped out at me is the power level entry on line 9. This is a “desktop” ThinkCentre M720q which is really laptop hardware in a small form factor case. I looked in power settings and the screen was is told to turn off after 10 minutes. That was it. There is no mention of a lid close action, so I don’t think the OS is confusing it with a laptop. It’s just kind of odd.

Does anything jump out to you?

No, but I have to be off now. my day is ending, but it might jump out for someone else.

Understood. Thank you again for the help!

Circling back around to this issue. The past month has been crazy and I have not had time to dig back into this.

I am still having random log outs. I have read the logs and I am not seeing anything jumping out at me. The only thing that looks like an error is the Samba timeout failure. What verbiage should I look for to find exactly when a session has ended?

Try:

journalctl --boot=-1 --grep='session\|log' --no-pager

It’s thee same as the previous one, but this time it searrches for the terms session or log (as part of log -in/out.)

This actually makes me feel better. Nothing came back on that command:

    ~  journalctl --boot=-1 --grep='session\|log' --no-pager                   ✔ 
-- No entries --
    ~  journalctl --boot=-2 --grep='session\|log' --no-pager                 1 ✘ 
-- No entries --
    ~  journalctl --boot=-3 --grep='session\|log' --no-pager                 1 ✘ 
-- No entries --
    ~  journalctl --boot=-4 --grep='session\|log' --no-pager                 1 ✘ 
-- No entries --
    ~  journalctl --boot=-0 --grep='session\|log' --no-pager                 1 ✘ 
-- No entries --
    ~                                                                        1 ✘ 

So does the absence of these terms reveal something?

Not to me, nope.

Sorry.

:sob:

As a footnote to this thread - for a completely unrelated reason, I decided to install and check out Wayland. It dawned on me today that I have not had the random log out in 8 days.

I don’t know why or what exactly this means, but Wayland has been fine and I see no reason to go back to the X server.