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