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".