Announcement

Collapse
No announcement yet.

Kubuntu hangs on shutdown (but only from GUI)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Kubuntu hangs on shutdown (but only from GUI)

    Hi all.

    I'm on Kubuntu 2204 LTS (Linux MONOLITH 5.19.0-43-generic #44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon May 22 13:39:36 UTC 2 x86_64 x86_64 x86_64 GNU/Linux).

    It runs great but when I try to shutdown from the GUI it hangs. I can do "shutdown now" from the command line and it shuts down fine.

    Here's an image of what it looks like when it hangs: https://ibb.co/RT73fQp

    I clicked "shutdown" during the countdown - the screen went fuzzy/low contrast (part of the normal shutdown animation) and then froze. It does that every time.

    I have to power cycle the machine to get it to boot again.

    Here are the last few messages in syslog before I had to power cycle it - all are within < 5 seconds (maybe < 0.5 seconds) of me clicking "shutdown":
    Code:
    Jun 10 12:38:36 MONOLITH systemd[1291]: app-org.kde.konsole-a8c4380d684e4c3f8c140b448b826170.scope: Consumed 1.570s CPU time.
    Jun 10 12:38:36 MONOLITH systemd[1291]: app-org.kde.dolphin-f1119233c6bf45e98410e3e322f15dbe.scope: Consumed 1.939s CPU time.
    Jun 10 12:38:36 MONOLITH dbus-daemon[1409]: [session uid=1000 pid=1409] Activating service name='org.kde.kdeconnect' requested by ':1.43' (uid=1000 pid=2215 comm="/usr/bin/plasmashell " label="unconfined")
    Jun 10 12:38:37 MONOLITH org.kde.kdeconnect[5311]: Qt: Session management error: Protocol Setup Failed, reason : Connection rejected: ksmserver is shutting down
    Jun 10 12:38:37 MONOLITH dbus-daemon[1409]: [session uid=1000 pid=1409] Successfully activated service 'org.kde.kdeconnect'
    Jun 10 12:38:37 MONOLITH kernel: [ 851.117480] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
    Jun 10 12:38:37 MONOLITH kernel: [ 851.119317] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
    Jun 10 12:38:37 MONOLITH kernel: [ 851.119360] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
    Jun 10 12:38:37 MONOLITH org.kde.kdeconnect[5311]: kdeconnect.core: Could not query capabilities from notifications server
    Any advice on how to debug this?​

    (FWIW, it's a Intel desktop, not a laptop, and I'm not trying to hibernate. Just a plain shutdown.)





    Last edited by Dave92f1; Jun 10, 2023, 12:34 PM. Reason: Clarified about hibernation

    #2
    Do you have kdeconnect installed and running?
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    Comment


      #3
      I suggest seeing the messages during the shutdown. Edit /etc/default/grub to remove the words "quiet splash" from the setting of GRUB_CMDLINE_LINUX (and GRUB_CMDLINE_LINUX_DEFAULT if they're there). Then run sudo update-grub. This will let you see what is happening during boot up and shut down, and the last message might give some clues. It might not take effect at the very next shutdown.
      Regards, John Little

      Comment


        #4
        @GreyGeek: Yes, kdeconnect appears to be installed and running. I don't use it at all - it's just there from the default Kubuntu install config.

        @jlittle: I did that. Behavior seems to be exactly the same. If there are messages on the command-line shutdown, they go past too fast for me to see (and that is working OK anwyay). Shutting down from the GUI it locks up instantly the same as before - no messages. (Maybe the text messages go on longer at bootup; hard to tell. But bootup isn't a problem.)


        Code:
        dave@MONOLITH:~$ cat /etc/default/grub
        # If you change this file, run 'update-grub' afterwards to update
        # /boot/grub/grub.cfg.
        # For full documentation of the options in this file, see:
        # info -f grub -n 'Simple configuration'
        
        GRUB_DEFAULT=0
        GRUB_TIMEOUT_STYLE=hidden
        GRUB_TIMEOUT=0
        GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
        #GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
        GRUB_CMDLINE_LINUX_DEFAULT=""
        GRUB_CMDLINE_LINUX=""
        
        # Uncomment to enable BadRAM filtering, modify to suit your needs
        # This works with Linux (no patch required) and with any kernel that obtains
        # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
        #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xe fefefef"
        
        # Uncomment to disable graphical terminal (grub-pc only)
        #GRUB_TERMINAL=console
        
        # The resolution used on graphical terminal
        # note that you can use only modes which your graphic card supports via VBE
        # you can see them in real GRUB with the command `vbeinfo'
        #GRUB_GFXMODE=640x480
        
        # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
        #GRUB_DISABLE_LINUX_UUID=true
        
        # Uncomment to disable generation of recovery mode menu entries
        #GRUB_DISABLE_RECOVERY="true"
        
        # Uncomment to get a beep at grub start
        #GRUB_INIT_TUNE="480 440 1"
        dave@MONOLITH:~$ sudo update-grub
        [sudo] password for dave:
        Sourcing file `/etc/default/grub'
        Sourcing file `/etc/default/grub.d/init-select.cfg'
        Generating grub configuration file ...
        Found linux image: /boot/vmlinuz-5.19.0-43-generic
        Found initrd image: /boot/initrd.img-5.19.0-43-generic
        Found linux image: /boot/vmlinuz-5.19.0-42-generic
        Found initrd image: /boot/initrd.img-5.19.0-42-generic
        Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting
        Warning: os-prober will not be executed to detect other bootable partitions.
        Systems on them will not be added to the GRUB boot configuration.
        Check GRUB_DISABLE_OS_PROBER documentation entry.
        Adding boot menu entry for UEFI Firmware Settings ...
        done
        dave@MONOLITH:~$


        Comment


          #5
          Originally posted by Dave92f1 View Post
          It runs great but when I try to shutdown from the GUI it hangs.
          When you shutdown from the Desktop (K > Shut Down), you get presented with options to Sleep, Restart, Shut Down, Log Out. A 30-second count down starts. Click on Shut Down to bypass the 30-second count down delay.
          Using Kubuntu Linux since March 23, 2007
          "It is a capital mistake to theorize before one has data." - Sherlock Holmes

          Comment


            #6
            Depending on what you mean by "hangs" a long shutdown or restart time could also have something to do with how systemd behaves…

            See: https://community.kde.org/Distributi..._configuration

            I always set DefaultTimeoutStopSec and DefaultTimeoutAbortSec in both /etc/systemd/system.conf and /etc/systemd/user.conf in desktop installations to either between 5 and 15s on newer computers or to 20 to 30s on older hardware.​

            Example
            Code:
            ### Reduce timeout (defaults = 90s / none)
            DefaultTimeoutStopSec=10s
            DefaultTimeoutAbortSec=10s​
            Last edited by Schwarzer Kater; Jun 14, 2023, 02:17 PM.
            Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
            Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

            get rid of Snap script (20.04 +)reinstall Snap for release-upgrade script (20.04 +)
            install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04)

            Comment


              #7
              Originally posted by Snowhog View Post
              When you shutdown from the Desktop (K > Shut Down), you get presented with options to Sleep, Restart, Shut Down, Log Out. A 30-second count down starts. Click on Shut Down to bypass the 30-second count down delay.
              Yes, that's what I've been doing. That's when the system locks up, when I click "shutdown" (or "restart"). I've waited as long as 20 minutes after that - system remains hung.

              This is a new i9 machine with 64 GB RAM and a 2 TB SSD. It's not old or slow.

              Comment


                #8
                Originally posted by Dave92f1 View Post
                I've waited as long as 20 minutes after that - system remains hung
                Yep. That isn’t normal for sure!
                Using Kubuntu Linux since March 23, 2007
                "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                Comment


                  #9
                  Have you created another user account and tested to see if the behavior is any different?
                  Using Kubuntu Linux since March 23, 2007
                  "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                  Comment


                    #10
                    Originally posted by Dave92f1 View Post
                    Yes, that's what I've been doing. That's when the system locks up, when I click "shutdown" (or "restart"). I've waited as long as 20 minutes after that - system remains hung.

                    This is a new i9 machine with 64 GB RAM and a 2 TB SSD. It's not old or slow.
                    So what does sudo journalctl -b -1 -a in Konsole say after you have encountered the problem and booted anew?

                    Can you spot something within the last entries that shows why your machine hung?

                    You will have to look within the entries below something like
                    "… systemd-logind[…]: The system will reboot now!"
                    or
                    "… systemd[…]: Stopping Session X of User XXX...".
                    Last edited by Schwarzer Kater; Jun 15, 2023, 04:13 PM.
                    Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
                    Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

                    get rid of Snap script (20.04 +)reinstall Snap for release-upgrade script (20.04 +)
                    install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04)

                    Comment


                      #11
                      20 minutes is definitely a hang.
                      If you are not using KDEconnect then uninstall it so it is not using system resources, but I doubt it is the cause of your problem.
                      You can review all the events that took place during the previous boot up using
                      journalctl -b -1 -a
                      Your shutdown sequence begins with the power down
                      systemd-logind[619]: Powering Off...
                      and continues through to final shut down. However, all you are interested in is the sequence to shut down the desktop GUI
                      systemd-logind[619]: Powering Off...​
                      systemd[1]: unattended-upgrades.service: Deactivated successfully.
                      systemd-logind[619]: System is powering down.
                      sddm[701]: Authentication error: "Process crashed"
                      sddm[701]: Auth: sddm-helper crashed (exit code 15)
                      sddm[701]: Authentication error: "Process crashed"
                      sddm[701]: Auth: sddm-helper exited with 15
                      sddm[701]: Socket server stopping...
                      sddm[701]: Socket server stopped.
                      sddm[701]: Display server stopping...
                      systemd[1]: Stopping Session 3 of User jerry...
                      systemd[1]: Stopping Session 33 of User jerry...
                      systemd[1]: Removed slice Slice /system/modprobe.
                      systemd[1]: Removed slice Slice /system/postfix.
                      systemd[1]: Stopped target Graphical Interface.​
                      This is for my system. On your system somewhere between "Powering off..." and "Stopped target Graphical Interface" may be clues as to what is hanging on your system.
                      Last edited by GreyGeek; Jun 15, 2023, 02:33 PM.
                      "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                      – John F. Kennedy, February 26, 1962.

                      Comment

                      Working...
                      X