How can I retrieve messages that splash on the screen, just before shutdown?  [Solved]

Help with the version of MX KDE officially released by the Development Team.
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
SO2001
Posts: 33
Joined: Sun Jun 26, 2022 4:26 am

How can I retrieve messages that splash on the screen, just before shutdown?  [Solved]

#1 Post by SO2001 »

A few times, when I did a shutdown (or restart), I happened to see a number of text lines, right before the computer shut down completely. About 3 times there were about 10-15 of such text lines. It flashes by too fast to be able to read them. Is there a program that let's me look back what these messages were?


Operating System: Debian GNU/Linux 11
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Kernel Version: 5.10.0-15-amd64
OS Type: 64-bit
Last edited by SO2001 on Thu Jul 07, 2022 12:05 am, edited 1 time in total.

Earl57
Posts: 28
Joined: Tue Mar 18, 2014 3:26 pm

Re: How can I retrieve messages that splash on the screen, just before restarting?

#2 Post by Earl57 »

Try var/log/boot.log. I had to open it as root.

SO2001
Posts: 33
Joined: Sun Jun 26, 2022 4:26 am

Re: How can I retrieve messages that splash on the screen, just before restarting?

#3 Post by SO2001 »

Newbie question: how do I open var/log/boot.log as root?

In the right click context menu I can change "ownership to root" or "ownership to active user". Should I select one of those 2 options? I dont dare mess with these on my own, afraid I will bork the system....

User avatar
Eadwine Rose
Administrator
Posts: 14477
Joined: Wed Jul 12, 2006 2:10 am

Re: How can I retrieve messages that splash on the screen, just before restarting?

#4 Post by Eadwine Rose »

I just click edit as root. And then don't edit it ;)
MX-23.6_x64 July 31 2023 * 6.1.0-34amd64 ext4 Xfce 4.20.0 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.216.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030

Huckleberry Finn

Re: How can I retrieve messages that splash on the screen, just before restarting?

#5 Post by Huckleberry Finn »

Code: Select all

sudo cat /var/log/boot.log
However, probably that won't display exactly what you want.

So, here's it: https://forum.mxlinux.org/viewtopic.php ... 20#p684220

User avatar
markol
Posts: 414
Joined: Sat Jan 30, 2021 8:33 am

Re: How can I retrieve messages that splash on the screen, just before restarting?

#6 Post by markol »

You can install KDE's KSystemLog via Synaptic/Discover/.. or terminal:

Code: Select all

sudo apt install ksystemlog

SO2001
Posts: 33
Joined: Sun Jun 26, 2022 4:26 am

Re: How can I retrieve messages that splash on the screen, just before shutdown?

#7 Post by SO2001 »

I rightclicked the boot.log file in var/log/boot.log and selected "ownership to active user". Afterwards I changed it back to "ownership to root". The bootlog file gave information about one startup yesterday. No other startups info. And it only seemed to be info about starting the OS up, not shutting it down.

I have installed Ksystemlog now. I have changed the settings to save the logs for multiple boots, because what I am eager to find out is what the messages are right before shutdown (or restart), not the ones during startup. Right before the screen goes completely black before shutdown, sometimes there are a lot of textlines.

Now I am waiting for these textlines to appear again and now they (ofcourse) dont :).

Ksytemlog has lots of information and I guess that I have to select the systemlog, because that seems to have the most relevant info. In the systemlog tab I then select the date tab, so I can scroll down to the time my computer shut down.
But again, now I have to wait for these messages to appear again... :)

SO2001
Posts: 33
Joined: Sun Jun 26, 2022 4:26 am

Re: How can I retrieve messages that splash on the screen, just before shutdown?

#8 Post by SO2001 »

Yes, I had one of those moments again, that right before shutdown, some 15-20 textlines very briefly appeared. I searched for the time my computer shutdown in the system log of the program Ksystemlog, but I couldnt find/recognize the messages. Because Ksystemlog keeps putting in new entries in the system log all the time, while I was reading, I couldnt keep the page frozen at one point, for me to read all the many entries well.

No biggie, it's nice to have Ksystemlog installed anyway, especially if there are severe errors, then Ksystemlog is the place to look, as far as I know. And there arent any severe errors. That's positive!

User avatar
markol
Posts: 414
Joined: Sat Jan 30, 2021 8:33 am

Re: How can I retrieve messages that splash on the screen, just before shutdown?

#9 Post by markol »

SO2001 wrote: Thu Jul 07, 2022 12:22 pm I searched for the time my computer shutdown in the system log of the program Ksystemlog, but I couldnt find/recognize the messages. Because Ksystemlog keeps putting in new entries in the system log all the time, while I was reading, I couldnt keep the page frozen at one point, for me to read all the many entries well.
Here you go:
https://docs.kde.org/stable5/en/ksystem ... ading.html
KSystemLog provides an easy way to control the reading and the monitoring of log files. Indeed, sometimes you only need to analyze some existing log lines. In this case, you cannot tolerate the appearance of a new line. You can deactivate the monitoring of log files by clicking on the Stop button. This stops the opened log files from being updated while still letting them get filled by other processes. Of course, you can reactivate the monitoring by clicking on Resume, which will display the log lines added since the last pause.

Stuart_M
Posts: 691
Joined: Wed Aug 07, 2019 7:10 pm

Re: How can I retrieve messages that splash on the screen, just before shutdown?

#10 Post by Stuart_M »

I know you were asking about a way to "look back what these messages were", but I do not believe that is possible from the system logs because the file system is being dismounted as part of the shutdown (halt) procedure.

There are other ways to record this information such as taking a video or image of the screen during shutdown or using a video capture card (from another computer?) to record the video output from the motherboard, etc., but they are not really practical.

I found a way that will pause the end of the rapidly scrolling text that occurs during a shutdown or restart. While it will NOT write that information to a log file, it will pause the text so it can be read and then "Enter" is used to complete the shutdown (halt).

While this works to read the text, it will not allow scrolling or paging the text so there is no way to read any text above the top line in the screen.

PgUp/Dn does not work, Shift+PgUp/Dn no longer works (see bullet below), and the 25+ special key combinations I tried do not work. I tried the screen and tmux commands but that is useless here because any command to enter needs the Enter key to run, and that same key is what resumes the shutdown process.
  • Shift+PgUp/Dn did work a few years ago to page up/down when paused but not now because beginning with kernel 5.9 it is no longer supported (thank you Linus Torvalds) https://www.phoronix.com/scan.php?page= ... Scrollback

    I also tested MX-21 using the 4.19.202 kernel because I thought Shift+PgUp/Dn would work with kernels earlier than 5.9 but it did not.
For some reason pausing does not work with MX-19 Xfce (4.19.0-18 and 5.10.0-15 were tested). When MX-19 is shutdown, about 1.5 pages of text will quickly scroll by ending with only one line on the screen: "Shutting down system...". That will remain for about 3 seconds and then the shutdown completes ending with the computer powering off. That is normal MX-19 shutdown behavior.

However when pausing the text, "Shutting down system..." will remain on the screen indefinitely and the keyboard, while recognized, will have no effect on the system regardless of any key or key combination used (the "Press Enter to continue" prompt never appears). The only thing to do at this point is to remove power from the computer or reset or hold the power switch in for several seconds so the motherboard will take control.

The pause function DOES work on MX-21 Xfce 5.10.0-15 (I also tested with 4.19.202-antix.1-amd64-smp) but both will only pause on the last full screen of text. Any text above that is not accessible, at least not that I am aware of.

I took a video of the monitor showing the shutdown text scrolling by. I was using the pause feature and pieced together two images from that video so all the lines of text appear in this one image. The text has stopped scrolling and is waiting for the Enter key to finish the shutdown (Ctrl+D or typing in "exit" will also work) as can be seen on the bottom line. The red rectangle at the top shows the text that cannot be seen when the "Press Enter to continue" line is displayed at the bottom. A 1920x1080 screen is being used so with that screen resolution and my system there are only five lines that cannot be read.
shutdown_text_last_window.jpg


Since you said that you were new (Post #3) I will try to make the procedure as easy as possible by using the Terminal so only commands are needed to configure the files.

In testing I used MX-21 Xfce with the Thunar file manager so I don't know if KDE will produce the same results.

1. In /etc/init.d/, create a new document called "pause_hook". There are several ways to do this but the easiest will be to simply run the below command. When this command is pasted into the terminal a warning will appear "Unsafe Paste" because the command contains line feeds. If you trust the code (I do) then click on "Paste". If not then use the text in the next code window to manually add it to the "pause_hook" file.

Code: Select all

sudo tee /etc/init.d/pause_hook <<!
#! /bin/sh
### BEGIN INIT INFO
# Provides:          pause_hook
# Required-Start:
# Required-Stop:     halt reboot
# Default-Start:
# Default-Stop:      0 6
# X-Stop-After:      umountroot
# X-Interactive:     true
# Short-Description: Pause before halt or reboot
# Description:
### END INIT INFO

do_stop () {
    [ -r /etc/pause_hook.conf ] && . /etc/pause_hook.conf

    [ "\$PAUSE_HOOK_ENABLED" = true ] && read -p "Press Enter to continue" reply
}

case "\$1" in
    start)
        # No-op
        ;;
    restart|reload|force-reload)
        echo "Error: argument '\$1' not supported" >&2
        exit 3
        ;;
    stop)
        do_stop
        ;;
    *)
        echo "Usage: \$0 start|stop" >&2
        exit 3
        ;;
esac
!


If you want to manually put the text into the "pause_hook" file then use this text:

Code: Select all

#! /bin/sh
### BEGIN INIT INFO
# Provides:          pause_hook
# Required-Start:
# Required-Stop:     halt reboot
# Default-Start:
# Default-Stop:      0 6
# X-Stop-After:      umountroot
# X-Interactive:     true
# Short-Description: Pause before halt or reboot
# Description:
### END INIT INFO

do_stop () {
    [ -r /etc/pause_hook.conf ] && . /etc/pause_hook.conf

    [ "$PAUSE_HOOK_ENABLED" = true ] && read -p "Press Enter to continue" reply
}

case "$1" in
    start)
        # No-op
        ;;
    restart|reload|force-reload)
        echo "Error: argument '$1' not supported" >&2
        exit 3
        ;;
    stop)
        do_stop
        ;;
    *)
        echo "Usage: $0 start|stop" >&2
        exit 3
        ;;
esac
!

2. Make the Step 1 file executable by running the below command:

Code: Select all

sudo chmod -c 755 /etc/init.d/pause_hook
If the command is successful then the output should look like this:

Code: Select all

mode of '/etc/init.d/pause_hook' changed from 0644 (rw-r--r--) to 0755 (rwxr-xr-x)
3. Run the below command so the script will be run at shutdown or reboot. This will add "pause_hood" as a service:

Code: Select all

sudo update-rc.d pause_hook defaults
4. Now "pause_hood" needs to be enabled. Create /etc/pause_hook.conf and add "PAUSE_HOOK_ENABLED=true" (without the quotes) in the "pause_hook.conf" file. An easy way to do all of that is to run the below command (see the step 1 "Paste" warning - it's okay to click on "Paste" at this point - otherwise do it manually):

Code: Select all

sudo tee /etc/pause_hook.conf <<!
PAUSE_HOOK_ENABLED=true
!
That's it. The next time there is a shutdown or restart, the scrolling text will (should) be paused until "Enter" is used to complete the action.

To disable the pause on shutdown/restart, just go into the /etc/pause_hook.conf file and comment out the only line there, which will then look like "#PAUSE_HOOK_ENABLED=true" (without the quotes). To enable it, just un-comment it (remove the number symbol "#"). This must be done as root of which there are several ways. One way, in Thunar, is to right-click that file and select "Edit as Root".
You do not have the required permissions to view the files attached to this post.

Post Reply

Return to “MX KDE Official Release”