How to determine the cause of shutdown in a previous session?

10 réponses [Dernière contribution]
Sergey
Hors ligne
A rejoint: 06/01/2020

Good afternoon. :)

I installed Trisquel a few years ago and it behaved quite stably. However, recently the laptop began to turn off spontaneously from time to time. Moreover, it does not crash, namely, turn off, as if I myself had given him the command to turn off. I wanted to see the logs, but I could not figure out what and where was on my own. Therefore, please help.

I also tested the memory with memtest86+ utility, there were no problems. Notebook Acer ES1-531 with Intel N3700 processor and 2GB of RAM.

Please help determine the cause of this behavior.

Magic Banana

I am a member!

I am a translator!

Hors ligne
A rejoint: 07/24/2010

You can use the 'journalctl' command in a terminal. Use the option -p to filter by priority. For instance to only see errors or worse:
$ journalctl -p 3

Sergey
Hors ligne
A rejoint: 06/01/2020

Thanks for the answer. Yesterday I reinstalled the system, but it still periodically shuts down. I entered your code, errors were detected, but, as I understood it in the current session.

sergey@pc:~$ journalctl -p 3
-- Logs begin at Пт 2020-06-05 11:18:01 MSK, end at Пт 2020-06-05 11:18:59 MSK. --
июн 05 11:18:05 pc systemd-udevd[553]: failed to execute '/lib/udev/mtp-probe' 'mtp-probe /sys/devices/pci0000:00/0000:00:
июн 05 11:18:06 pc systemd-udevd[654]: failed to execute '/lib/udev/mtp-probe' 'mtp-probe /sys/devices/pci0000:00/0000:00:
июн 05 11:18:06 pc kernel: 1-5.1: Missing Free firmware (non-Free firmware loading is disabled)
июн 05 11:18:06 pc kernel: Bluetooth: Patch file not found /*(DEBLOBBED)*/
июн 05 11:18:06 pc kernel: Bluetooth: Loading patch file failed
июн 05 11:18:12 pc mdadm[891]: DeviceDisappeared event detected on md device /dev/md/2
июн 05 11:18:12 pc mdadm[891]: DeviceDisappeared event detected on md device /dev/md1
июн 05 11:18:12 pc ntpdate[924]: name server cannot be used: Temporary failure in name resolution (-3)
июн 05 11:18:14 pc kernel: 0000:01:00.0: Missing Free firmware (non-Free firmware loading is disabled)
июн 05 11:18:14 pc NetworkManager[816]: nm_device_get_device_type: assertion 'NM_IS_DEVICE (self)' failed
июн 05 11:18:14 pc wpa_supplicant[990]: dbus: wpa_dbus_get_object_properties: failed to get object properties: (none) none
июн 05 11:18:14 pc wpa_supplicant[990]: dbus: Failed to construct signal

Magic Banana

I am a member!

I am a translator!

Hors ligne
A rejoint: 07/24/2010

According to 'man journalctl', option --boot (-b) "show messages from a specific boot". However, on my system:
$ journalctl -b -1
Specifying boot ID has no effect, no persistent journal was found

According to 'man journald.conf':

Storage=
Controls where to store journal data. One of "volatile", "persistent", "auto" and "none". If "volatile", journal log data will be stored only in memory, i.e. below the /run/log/journal hierarchy (which is created if needed). If "persistent", data will be stored preferably on disk, i.e. below the /var/log/journal hierarchy (which is created if needed), with a fallback to /run/log/journal (which is created if needed), during early boot and if the disk is not writable. "auto" is similar to "persistent" but the directory /var/log/journal is not created if needed, so that its existence controls where log data goes. "none" turns off all storage, all log data received will be dropped. Forwarding to other targets, such as the console, the kernel log buffer, or a syslog socket will still work however. Defaults to "auto".

In my /etc/systemd/journald.conf, Storage is left to its default value. If it is the same on yours, you may want "Storage=persistent" in it.

nadebula.1984
Hors ligne
A rejoint: 05/01/2018

The worst possibility is hardware failure. I had a coreboot X230 which often automatically power-off (several times per day). It turned out to be chipset physical damage, so I sold it to someone else.

Sergey
Hors ligne
A rejoint: 06/01/2020

Good afternoon.
Logging has helped, apparently the whole point is a malfunction of the power button. Or in the internal circuits... Now I’m thinking how can I turn off the PC off programmatically at the click of a button?

...
июн 06 22:25:09 pc systemd-logind[803]: Power key pressed. ( I did not press the button! )
июн 06 22:25:09 pc systemd-logind[803]: Powering Off...
июн 06 22:25:13 pc systemd-logind[803]: System is powering down.
...
июн 06 22:53:51 pc systemd-logind[817]: Power key pressed. (I did not press the button! )
июн 06 22:53:51 pc systemd-logind[817]: Powering Off...
июн 06 22:53:52 pc systemd-logind[817]: System is powering down.
...
июн 06 23:02:02 pc systemd-logind[858]: System is powering down. ( Normal completion. )
...

Magic Banana

I am a member!

I am a translator!

Hors ligne
A rejoint: 07/24/2010

Now I’m thinking how can I turn off the PC off programmatically at the click of a button?

The default MATE desktop environment has an entry "Shut Down..." at the bottom of the main menu and you can add a button doing the same on any panel. What desktop environment do you use?

Sergey
Hors ligne
A rejoint: 06/01/2020

I am using LXDE now.

Magic Banana

I am a member!

I am a translator!

Hors ligne
A rejoint: 07/24/2010

Searching the Web for "LXDE shutdown" returns many results. Some suggest installing GDM. That said, I guess not having any "Shut Down..." button in Trisquel Mini is not "normal", otherwise we would have probably heard of it on this forum... or, maybe, there are fewer Trisquel Mini users than I imagine. MATE is not much heavier, by the way.

Sergey
Hors ligne
A rejoint: 06/01/2020

Yes, I know, I’m just used to XFCE, so LXDE seemed closer to me. In addition, it comes with the kit. :) Anyway, thank you very much.

Magic Banana

I am a member!

I am a translator!

Hors ligne
A rejoint: 07/24/2010

Again: installing GDM may give you the desired button. And you can have an Xfce desktop environment, if you want it: install the xfce4 package, log out and, choose Xfce on the graphical login screen. Then, you may want to complete your desktop environment, installing additional xfce4-* packages. There are dozens of them.