Score:1

Ubuntu PC Shutting down overnight - Firefox snap?

id flag

The last few nights my PC (running Ubuntu 22.04 LTS) has been shutting down between 11pm and midnight for reasons I do not understand so looked at syslog. This is I think the relevant part:

Nov  6 23:02:00 Martha smartd[726]: Device: /dev/sda [SAT], SMART Usage Attribute: 190 Airflow_Temperature_Cel changed from 75 to 69
Nov  6 23:06:48 Martha gnome-shell[1300]: Window manager warning: Invalid WM_TRANSIENT_FOR window 0x3000007 specified for 0x3000005.
**Nov  6 23:07:17 Martha kernel: [32732.108304] audit: type=1107 audit(1667776037.990:87): pid=703 uid=102 auid=4294967295 ses=4294967295 subj=? msg='apparmor="DENIED" operation="dbus_signal"  bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.login1.Manager" member="PrepareForShutdown" name=":1.3" mask="receive" pid=8740 label="snap.firefox.firefox" peer_pid=734 peer_label="unconfined"
Nov  6 23:07:17 Martha kernel: [32732.108304]  exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'**
Nov  6 23:07:17 Martha kernel: [32732.108327] audit: type=1420 audit(1667776037.990:88): subj_apparmor=unconfined
Nov  6 23:07:18 Martha systemd[1]: unattended-upgrades.service: Deactivated successfully.
Nov  6 23:07:18 Martha systemd[1]: Stopping Session 1 of User xxxxxxx
Nov  6 23:07:18 Martha systemd[1]: Removed slice Slice /system/getty.
Nov  6 23:07:18 Martha systemd[1]: Removed slice Slice /system/modprobe.
Nov  6 23:07:18 Martha systemd[1]: Stopped target Preparation for Logins.
Nov  6 23:07:18 Martha systemd[1]: Stopped target Graphical Interface.
Nov  6 23:07:18 Martha systemd[1]: Stopped target Multi-User System.
Nov  6 23:07:18 Martha systemd[874]: Stopped target GNOME X11 Session (session: ubuntu).
Nov  6 23:07:18 Martha systemd[874]: Stopped target GNOME Session.
....

The PC is at this time unattended but often processing several long (timewise) bash scripts which are of course terminated meaning that I start the next day trying to establish where they have got to and restart at the appropriate points.

Why is this happening and how can I prevent it?

Any thoughts welcome

Peter

user535733 avatar
cn flag
Looks to me like Firefox is *receiving* the signal along with the rest of the system.
Matias N Goldberg avatar
vg flag
Your system is overheating and shutting down to prevent damage. It's right there in the log. Your disk is reaching 75°C which is past safe temps for either HDD and SSD.
PeterMcN avatar
id flag
This continues to happen nightly despite having done a "snap refresh" and being assured "All snaps up to date"
PeterMcN avatar
id flag
Matias I see it says that in the log but this system runs all day and all night (usually) and the disk temperature and if I check the temperature of SDA it s under 35C. If it were a true thermal problem why does it happen soon after 11pm every night.
pl flag
You said it yourself, it's processing long running scripts.
PeterMcN avatar
id flag
Ah but last night the scripts finished before 10:30 (unusually light load) and it didn't shut down until after 11pm. It has been working hard for last six hours (all 8 cores and all three disks) and none of the disks are above 35C. I don't believe that in cooler room (unheated at night) and with a lighter load the temperature is really 75C. That disk (SDA) is not used by the scripts and drive settings say it should be in standby mode after 10 minutes so it shouldn't even be spinning at 11pm!
petep avatar
in flag
Check to see if automatic update are cause.
ar flag
The only time I have experienced spontaneous shutdown in Ubuntu was due to high temperature. [Check the CPU temperature of your computer](https://itsfoss.com/check-laptop-cpu-temperature-ubuntu/). If it is in the 80s C or higher, you may have a cooling problem. If the computer is on 24/7 for years, sometimes dust clog up the vents and need to be cleaned.
Score:0
it flag

Check your /var/log/auth.log. I've seen similar issues and in some cases, the auth.log will contain lines like:

Jan 1 10:22:43 localhost systemd-logind[4805]: Power key pressed.
Jan 1 10:22:43 localhost systemd-logind[4805]: Powering Off...
Jan 1 10:22:43 localhost systemd-logind[4805]: System is powering down.

Of course in your case I guess noone is pressing the power button, however it could be a faulty button or something similar. Also some keyboards have a "poweroff" button and that can be faulty as well. You can add this into /etc/systemd/logind.conf to make the power button disabled:

HandlePowerKey=ignore

Hope it helps or at least rules out another possibility for you!

David avatar
cn flag
Did you read the comments and look at the question carefully? The machine is over heating. It is a thermal shutdown.
Istvan Devai avatar
it flag
Yes I have read it carefully. I'm not saying it is not possible that there is overheat which causes the shutdown, however the log does not contain clear evidence of this and also the reporter does not seem to agree. Also, note that there is a 5 minute time difference between the smartd log and the time of the shutdown, which again does not point to a causal relationship. I've done some googling about similar issues and what I described above is one of the possible causes.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.