Computer takes a long time to shutdown after a long session

Hey,

Regularly (but not always) after a long session, a shutdown or reboot takes a long time before it’s powered of, or I get to the bootloader again (in case of a reboot). It usually just shows the splashscreen (the Lenovo Legion logo), appears to be stuck, and sometimes I just let it do its thing and leave it be, sometimes I just force shut it down because it’s way too long and I can’t afford to just wait forever.

Tonight the laptop was behaving a bit weirdly so I decided to reboot it. It got stuck in that long splashscreen, but at some point the splashscreen went away and I saw messages on the screen instead. I took a photo of it which I’ll add to this post, and I’ll also try to write down what was in that. I also ran journalctl on the following boot to see if I could see those messages.

The photo:

My best attempt to a transcription:

[FAILED] Failed unmounting Temporary Directory (/tmp).
[41281.285761] systemd-shutdown[1]: Waiting for process: python3, iw, steam, python3, lightcord, steam, steamwebhelper, NetwordManager, steamwebhelper, npm, gnome-sessionsf, snap, wpa_supplicant, dbus-daemon, steamwebhelper, python3, at-spi-laun, nextcloud
[41371.292152] systemd-shutdown[1]: Waiting for process: at-spi-laun, python3, steamwebhelper, gnome-session-f, steamwebhelper, steam, dbus-daemon, steamwebhelper, python3, nextcloud, wpa_supplicant, snap, steam, iw, lightcord, NetwordManager, python3, steamwebhelper, npm

journalctl -b -1:

maj 16 00:41:38 valhalla systemd[1]: systemd-sysusers.service: Succeeded.
maj 16 00:41:38 valhalla audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-sysusers comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
maj 16 00:41:38 valhalla systemd[1]: Stopped Create System Users.
maj 16 00:41:38 valhalla systemd[1]: systemd-remount-fs.service: Succeeded.
maj 16 00:41:38 valhalla audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-remount-fs comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
maj 16 00:41:38 valhalla systemd[1]: Stopped Remount Root and Kernel File Systems.
maj 16 00:41:39 valhalla systemd[1]: lvm2-monitor.service: Succeeded.
maj 16 00:41:39 valhalla systemd[1]: Stopped Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling.
maj 16 00:41:39 valhalla audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=lvm2-monitor comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
maj 16 00:41:39 valhalla systemd[1]: Reached target Shutdown.
maj 16 00:41:39 valhalla systemd[1]: Reached target Final Step.
maj 16 00:41:39 valhalla audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-reboot comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
maj 16 00:41:39 valhalla audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-reboot comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
maj 16 00:41:39 valhalla systemd[1]: systemd-reboot.service: Succeeded.
maj 16 00:41:39 valhalla systemd[1]: Finished Reboot.
maj 16 00:41:39 valhalla systemd[1]: Reached target Reboot.
maj 16 00:41:39 valhalla systemd[1]: Shutting down.
maj 16 00:41:39 valhalla audit: BPF prog-id=38 op=UNLOAD
maj 16 00:41:39 valhalla audit: BPF prog-id=37 op=UNLOAD
maj 16 00:41:39 valhalla audit: BPF prog-id=42 op=UNLOAD
maj 16 00:41:39 valhalla audit: BPF prog-id=41 op=UNLOAD
maj 16 00:41:39 valhalla audit: BPF prog-id=40 op=UNLOAD
maj 16 00:41:39 valhalla audit: BPF prog-id=39 op=UNLOAD
maj 16 00:41:39 valhalla audit: BPF prog-id=44 op=UNLOAD
maj 16 00:41:39 valhalla audit: BPF prog-id=43 op=UNLOAD
maj 16 00:41:39 valhalla systemd[1]: Using hardware watchdog 'iTCO_wdt', version 0, device /dev/watchdog
maj 16 00:41:39 valhalla systemd[1]: Set hardware watchdog to 10min.
maj 16 00:41:39 valhalla kernel: watchdog: watchdog0: watchdog did not stop!
maj 16 00:41:39 valhalla systemd-shutdown[1]: Syncing filesystems and block devices.
maj 16 00:41:39 valhalla dnsmasq[1312]: exiting on receipt of SIGTERM
maj 16 00:41:39 valhalla systemd-journald[211]: Journal stopped

does someone know what is going on with my laptop ?

is /tmp being mounted something you did? speed tweak?

i don’t see that in my install. i would assume with long sessions, the important stuff needs to be moved as /tmp is volatile & don’t survive reboot.

I didn’t do anything with /tmp, just whatever the manjaro gnome install iso does.

I checked in lsblk and in cat /etc/fstab and I can’t find anything about /tmp there.

I’ve had /tmp filled up in some sessions, but it’s usually when I’m trying to download build and install things from the AUR that need more space than what’s available in my RAM

what happens when you run the command in terminal?
systemctl reboot
systemctl poweroff

systemctl reboot made my system reboot, and it was very fast, don’t think I ever had the computer reboot this fast.

what desktop you use?

just going to add this before i boot my regular sway install.

if your using the standard xfce4 desktop.
right click your menu> properties> commands & change the reboot shutdown

I use Gnome. I’ll see if I can add that to the shutdown and reboot options.

What does it do differently, using systemctl reboot instead of a normal reboot ?

gnome uses gnome-session-quit

systemctl = is system
gnome-session-quit = is session

give me a minute, i’ll make you a script to try, need coffee first. :grin:

do you have a ~/bin folder? this should go in there.

in terminal:
mkdir ~/bin
gedit ~/bin/exit.sh
copy & paste

#!/bin/sh
if test -e "$HOME/.local/share/applications/exit.desktop"; then
        echo "launcher already created"
    else
        touch $HOME/.local/share/applications/exit.desktop; echo -e "[Desktop Entry]\nType=Application\nName=Exit\nExec=$PWD/exit.sh\nIcon=gnome-shutdown\nCategories=Other;" > $HOME/.local/share/applications/exit.desktop
fi

ans=$(zenity --info --title="Exit" --text="Select Action" --no-wrap --icon-name="gnome-shutdown" --ok-label="Cancel" --extra-button="Logout" --extra-button="Reboot" --extra-button="Shutdown")

case "$ans" in

Logout) gnome-session-quit --logout
    ;;
Reboot) systemctl reboot
    ;;
Shutdown) systemctl shutdown
    ;;
esac
exit 0

chmod +x ~/bin/exit.sh
sh ~/bin/exit.sh
click cancel for now

go into your applications & add to your dock/panel

test,test,test

still sleepy, forgot to put pic.

if successful you should have a new exit app.

I see, thanks, I’ll see if I can use this script or parts of it for my reboots, or even just the terminal

i tried booting my gnome install but it’s still very unusable on my rpi400.
hopefully they’ll get the gnome 40 stuff settled.