Shutdown hangs

Problem: system hangs at shutdown.

When initiating a shutdown the screen turns black and systems hangs.
Once I press the power key, shutdown completes. Any help on how to
debug (and fix) this is greatly appreciated. Thanks.

system log tells me this:

journalctl -b -1

===>

Apr 02 15:38:31 thishost kdeinit5[10185]: kf.kio.slaves.tags: tag fetch failed: “Failed to open the database”
Apr 02 15:38:31 thishost kdeinit5[10185]: kf.kio.slaves.tags: “tags:/” list() invalid url
Apr 02 15:38:31 thishost plasmashell[2718]: kf.kio.core: “Could not enter folder tags:/.”
Apr 02 15:38:32 thishost dbus-daemon[2014]: [session uid=1000 pid=2014] Activating service name=‘org.kde.LogoutPrompt’ requested by ‘:1.34’ (uid=1000 pid=2703 comm="/usr/bin/ksmserver “)
Apr 02 15:38:33 thishost dbus-daemon[2014]: [session uid=1000 pid=2014] Successfully activated service ‘org.kde.LogoutPrompt’
Apr 02 15:38:34 thishost ksmserver-logout-greeter[10187]: file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/UserDelegate.qml:41: ReferenceError: config is not defi>
…]
Apr 02 15:38:34 thishost ksmserver-logout-greeter[10187]: file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/UserDelegate.qml:34: ReferenceError: model is not defin>
Apr 02 15:38:34 thishost kwin_x11[2710]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 6828, resource id: 48308097, major code: 3 (GetWindowAttributes), minor code: 0
Apr 02 15:38:34 thishost kwin_x11[2710]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 6829, resource id: 48308097, major code: 14 (GetGeometry), minor code: 0
Apr 02 15:38:34 thishost ksmserver-logout-greeter[10187]: qt.svg: <input>:406:376: Could not add child element to parent element because the types are incorrect.
…]
Apr 02 15:38:36 thishost kwin_x11[2710]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 7267, resource id: 14680101, major code: 18 (ChangeProperty), minor code: 0
Apr 02 15:38:36 thishost polkit-kde-authentication-agent-1[2714]: Destroying listener
Apr 02 15:38:36 thishost polkit-kde-authentication-agent-1[2714]: Removing listener PolkitQt1::Agent::Listener(0x7f765800e8d0)
Apr 02 15:38:36 thishost akonadiserver[2842]: org.kde.pim.akonadiserver: Subscriber “AgentBaseChangeRecorder - 94109993184000” disconnected
…]
Apr 02 15:38:37 thishost polkitd[1127]: Unregistered Authentication Agent for unix-session:1 (system bus name :1.39, object path /org/kde/PolicyKit1/AuthenticationAgent, locale en_GB.UTF-8)
Apr 02 15:38:36 thishost akonadiserver[2842]: org.kde.pim.akonadiserver: Subscriber “MailFilterCollectionMonitor - 94336061993296” disconnected
…]
Apr 02 15:38:36 thishost org_kde_powerdevil[2826]: powerdevil: Core unloading
Apr 02 15:38:37 thishost akonadiserver[2842]: org.kde.pim.akonadiserver: Subscriber “ETMCalendarMonitor - 94809109676816” disconnected
…]
Apr 02 15:38:37 thishost kded5[2638]: Service “:1.44” unregistered
Apr 02 15:38:37 thishost kwin_x11[2710]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 7298, resource id: 41943048, major code: 18 (ChangeProperty), minor code: 0
…]
Apr 02 15:38:37 thishost akonadiserver[2842]: org.kde.pim.akonadiserver: Subscriber “AgentBaseChangeRecorder - 94126171560880” disconnected
Apr 02 15:38:37 thishost akonadi_control[2789]: org.kde.pim.akonadicontrol: Application ‘/usr/bin/akonadi_archivemail_agent’ exited normally…
…]
Apr 02 15:38:37 thishost akonadi_control[2789]: org.kde.pim.akonadicontrol: Application ‘/usr/bin/akonadi_migration_agent’ exited normally…
Apr 02 15:38:37 thishost plasmashell[2718]: trying to show an empty dialog
Apr 02 15:38:37 thishost plasmashell[2718]: QQmlExpression: Attempted to evaluate an expression in an invalid context
Apr 02 15:38:37 thishost plasmashell[2718]: QQmlExpression: Attempted to evaluate an expression in an invalid context
Apr 02 15:38:37 thishost kded5[2638]: Service “org.kde.StatusNotifierHost-2718” unregistered
Apr 02 15:38:37 thishost dbus-daemon[2014]: [session uid=1000 pid=2014] Activating service name=‘org.kde.kdeconnect’ requested by ‘:1.40’ (uid=1000 pid=2718 comm=”/usr/bin/plasmashell “)
Apr 02 15:38:37 thishost plasmashell[2718]: file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/global/Globals.qml:77:5: Unable to assign [undefined] to QObject*
Apr 02 15:38:37 thishost plasmashell[2718]: file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/global/Globals.qml:132: TypeError: Type error
Apr 02 15:38:37 thishost plasmashell[2718]: libkcups: Cancel-Subscription last error: 0 successful-ok
Apr 02 15:38:37 thishost plasmashell[2718]: libkcups: Create-Printer-Subscriptions last error: 0 successful-ok
Apr 02 15:38:37 thishost plasmashell[2718]: libkcups: Cancel-Subscription last error: 0 successful-ok
Apr 02 15:38:37 thishost plasmashell[2718]: file:///usr/share/plasma/plasmoids/org.kde.plasma.pkupdates/contents/ui/Full.qml:264:9: QML Button: Detected anchors on an item that is managed by a >
Apr 02 15:38:37 thishost plasmashell[2718]: file:///usr/share/plasma/plasmoids/org.kde.plasma.pkupdates/contents/ui/Full.qml:278:9: QML Button: Detected anchors on an item that is managed by a >
Apr 02 15:38:37 thishost plasmashell[2718]: file:///usr/share/plasma/plasmoids/org.kde.plasma.pkupdates/contents/ui/Full.qml:292:9: QML BusyIndicator: Detected anchors on an item that is manage>
Apr 02 15:38:37 thishost kwin_x11[2710]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 7402, resource id: 52437054, major code: 18 (ChangeProperty), minor code: 0
Apr 02 15:38:37 thishost kwin_x11[2710]: QMetaProperty::read: Unable to handle unregistered datatype ‘KWin::SessionState’ for property ‘KWin::EffectsHandler::sessionState’
Apr 02 15:38:37 thishost kwin_x11[2710]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 7403, resource id: 52428819, major code: 15 (QueryTree), minor code: 0
Apr 02 15:38:37 thishost kwin_x11[2710]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 7408, resource id: 52428819, major code: 18 (ChangeProperty), minor code: 0
Apr 02 15:38:37 thishost kwin_x11[2710]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 7474, resource id: 52428850, major code: 15 (QueryTree), minor code: 0
Apr 02 15:38:38 thishost dbus-daemon[2014]: [session uid=1000 pid=2014] Successfully activated service ‘org.kde.kdeconnect’
Apr 02 15:38:38 thishost dbus-daemon[2014]: [session uid=1000 pid=2014] Activating service name=‘org.freedesktop.Notifications’ requested by ‘:1.103’ (uid=1000 pid=10208 comm=”/usr/lib64/libexe>
Apr 02 15:38:40 thishost akonadi_control[2789]: org.kde.pim.akonadicontrol: Application ‘/usr/bin/akonadiserver’ exited normally…
Apr 02 15:39:03 thishost kdeconnectd[10208]: kdeconnect.core: Could not query capabilities from notifications server
Apr 02 15:39:38 thishost plasma_waitforname[10214]: org.kde.knotifications: WaitForName: Service was not registered within timeout
Apr 02 15:39:38 thishost dbus-daemon[2014]: [session uid=1000 pid=2014] Activated service ‘org.freedesktop.Notifications’ failed: Process org.freedesktop.Notifications exited with status 1

here system hangs, when power key is pressed, shutdown continues …

Apr 02 15:44:38 thishost systemd-logind[1162]: Power key pressed.
Apr 02 15:44:38 thishost systemd-logind[1162]: Powering Off…
Apr 02 15:44:38 thishost systemd-logind[1162]: System is powering down.
Apr 02 15:44:38 thishost systemd[1]: Stopping Session 1 of user gbeyerle.
Apr 02 15:44:38 thishost ModemManager[1231]: <info> Caught signal, shutting down…
Apr 02 15:44:38 thishost systemd[1]: Removed slice Slice /system/configure-printer.
…]
Apr 02 15:44:38 thishost systemd[1]: Stopped Daily rotation of log files.

system info:

inxi -aSCGImz
===>
System:
Kernel: 5.3.18-150300.59.60-default x86_64 bits: 64 compiler: gcc v: 7.5.0
parameters: BOOT_IMAGE=/boot/vmlinuz-5.3.18-150300.59.60-default
root=UUID=…]
…]
Desktop: KDE Plasma 5.18.6 tk: Qt 5.12.7 wm: kwin_x11 vt: 7 dm: SDDM
Distro: openSUSE Leap 15.3
Memory:
RAM: total: 5.8 GiB used: 1.81 GiB (31.3%)
RAM Report:
permissions: Unable to run dmidecode. Root privileges required.
CPU:
Info: model: Intel Core2 Duo E4400 bits: 64 type: MCP arch: Core Merom
family: 6 model-id: 0xF (15) stepping: 0xD (13) microcode: 0xA4
Topology: cpus: 1x cores: 2 smt: <unsupported> cache: L1: 128 KiB
desc: d-2x32 KiB; i-2x32 KiB L2: 2 MiB desc: 1x2 MiB
Speed (MHz): avg: 1770 high: 1797 min/max: 1200/2000 scaling:
driver: acpi-cpufreq governor: ondemand cores: 1: 1743 2: 1797
bogomips: 8029
Flags: ht lm nx pae sse sse2 sse3 ssse3
Vulnerabilities:
Type: itlb_multihit status: KVM: VMX unsupported
Type: l1tf mitigation: PTE Inversion
Type: mds
status: Vulnerable: Clear CPU buffers attempted, no microcode; SMT disabled
Type: meltdown mitigation: PTI
Type: spec_store_bypass status: Vulnerable
Type: spectre_v1
mitigation: usercopy/swapgs barriers and __user pointer sanitization
Type: spectre_v2 mitigation: Retpolines, STIBP: disabled, RSB filling
Type: srbds status: Not affected
Type: tsx_async_abort status: Not affected
Graphics:
Device-1: AMD Cedar [Radeon HD 5000/6000/7350/8350 Series]
vendor: Hightech Information System driver: radeon v: kernel
bus-ID: 01:00.0 chip-ID: 1002:68f9 class-ID: 0300
Display: x11 server: X.Org 1.20.3 compositor: kwin_x11 driver:
loaded: ati,radeon unloaded: fbdev,modesetting,vesa display-ID: :0
screens: 1
Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.0x11.2")
s-diag: 582mm (22.9")
Monitor-1: VGA-0 res: 1920x1080 hz: 60 dpi: 102
size: 477x268mm (18.8x10.6") diag: 547mm (21.5")
OpenGL:
renderer: AMD CEDAR (DRM 2.50.0 / 5.3.18-150300.59.60-default LLVM 11.0.1)
v: 3.3 Mesa 20.2.4 compat-v: 3.1 direct render: Yes

Long shutdowns are an ongoing issue. I have had shutdowns that repeatedly take 4:30 minutes. If you search the forum you will find at least a half dozen threads on this subject including several I have started. There does not seem to be a silver bullet solution. In my situation, the longs shutdowns just come and go. Eventually, they get shorter. Not a very helpful bit of information, I know.

One thing though, I have found that if you just leave system alone, it will shut down successfully. Might take 4:30 though, but will shut down and or restart. I think just waiting is less risky than powering off as something could get borked, I think. A cup of coffee helps.

Check out some of the other threads, there are many diagnostic steps outlined using systemd features that might give some clues.

Good luck, tom kosvic

Not happening here with similar Intel(R) Core™2 Duo CPU E8400 @ 3.00GHz and same GPU as OP:

# inxi -SIyz
System:
  Kernel: 5.3.18-150300.59.60-default arch: x86_64 bits: 64 Desktop: Trinity
    v: R14.0.11 Distro: openSUSE Leap 15.3
Info:...Shell: Bash  inxi: 3.3.14
# inxi -Gayz
Graphics:
  Device-1: AMD Cedar [Radeon HD 5000/6000/7350/8350 Series]
    vendor: PC Partner / Sapphire driver: radeon v: kernel pcie: gen: 2
    speed: 5 GT/s lanes: 16 ports: active: HDMI-A-1 empty: DVI-I-1,VGA-1
    bus-ID: 01:00.0 chip-ID: **1002:68f9** class-ID: 0300
  **Display**: x11 server: X.Org v: 1.20.3 **driver: X: loaded: modesetting**
    gpu: radeon display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 120 s-size: 406x228mm (15.98x8.98")
    s-diag: 466mm (18.33")
  Monitor-1: HDMI-A-1 mapped: HDMI-1 model: Samsung built: 2009
    res: 1920x1080 hz: 60 dpi: 305 gamma: 1.2 size: 160x90mm (6.3x3.54")
    diag: 184mm (7.2") ratio: 16:9 modes: max: 1920x1080 min: 720x400
  OpenGL:
    renderer: AMD CEDAR (DRM 2.50.0 / 5.3.18-150300.59.60-default LLVM 11.0.1)
    v: 3.3 Mesa 20.2.4 compat-v: 3.1 direct render: Yes

I suppose it could be related to the display driver. Inxi’s reports show OP’s using radeon, while I’m using modesetting.

Since I resolved my own issue with shutdown just today.

A general method is the following:

  • Store journal logs to the disk
  • Reboot
  • Search the logs for the service the slows down the shutdown
  • Decide what to do with this service

Let’s see one by one those steps

Store Journal logs to the disk

As root/with sudo execute the following commands:


mkdir /var/log/journal
chown :systemd-journal /var/log/journal
chmod 2755 /var/log/journal
killall -USR1 systemd-journald
reboot

Search the Logs
After the system is up again, extract the boot/shutdown logs:


journalctl --no-pager -b -1 > journal.log
vim ./journal.log 

:timeout

I was lazy and did this as root.

Decide what to do with the service
In my case, the service that was slowing down the shutdown was only one, the at-spi-dbus-bus.service. Please note that it could be a user’s service (It’s definitely a user service if you see a message about User Manager in the shutdown messages)

This is a user service. If you search around, you will see that it’s related to accessibility frameworks. I don’t use them, so it was an easy decision, stop it.
Please


systemctl --user stop at-spi-dbus-bus.service
systemctl --user mask at-spi-dbus-bus.service

In other cases (if a program hasn’t stopped properly, a service is buggy and systemd cannot kill it properly etc), you might want to simply kill it (SIGKILL) instead of waiting for it to finish. A method to do so, can be found in this post (Manjaro forums).

Great advice! Some remarks:

Journal defaults:

**erlangen:~ #** grep Storage /etc/systemd/journald.conf 
#**Storage**=auto 
**erlangen:~ #**

Searching for timeout in previous boot:

**erlangen:~ #** journalctl -b -1 -g timeout 
Apr 04 04:11:25 erlangen kernel: nvme nvme0: Shutdown timeout set to 8 seconds 
Apr 04 04:11:27 erlangen hd-idle[773]:   disk: sdb timeout: 300 
Apr 04 04:11:27 erlangen hd-idle[773]:   default timeout: 0 
Apr 04 04:12:25 erlangen dbus-daemon[772]: **[system] Failed to activate service 'org.bluez': timed out (service_start_****timeout****=25000ms)**
Apr 04 04:12:25 erlangen pulseaudio[1415]: **GetManagedObjects() failed: org.freedesktop.DBus.Error.TimedOut: Failed to activate service 'org.bluez': timed out (service_start_****timeout****=25000ms)**
Apr 04 04:12:25 erlangen kded5[1345]: **kf.bluezqt: PendingCall Error: "Failed to activate service 'org.bluez': timed out (service_start_****timeout****=25000ms)"**
Apr 04 04:14:04 erlangen kernel: nvme nvme0: Shutdown timeout set to 8 seconds 
Apr 04 04:34:07 erlangen kernel: nvme nvme0: Shutdown timeout set to 8 seconds 
**erlangen:~ #**

Searching for loaded user services:

karl@erlangen:~> systemctl list-units --user --type service  
  UNIT                                  LOAD   ACTIVE SUB     DESCRIPTION                                 
  at-spi-dbus-bus.service               loaded active running Accessibility services bus 
  dbus.service                          loaded active running D-Bus User Message Bus 
  dconf.service                         loaded active running User preferences database 
  gvfs-daemon.service                   loaded active running Virtual filesystem service 
  pipewire.service                      loaded active running PipeWire Multimedia Service 
  plasma-kactivitymanagerd.service      loaded active running KActivityManager Activity manager Service 
  plasma-kglobalaccel.service           loaded active running KDE Global Shortcuts Server 
  plasma-kscreen.service                loaded active running KScreen 
  plasma-xdg-desktop-portal-kde.service loaded active running Xdg Desktop Portal For KDE 
  pulseaudio.service                    loaded active running Sound Service 
  save-jalbum-settings.service          loaded active running Save jAlbum Project Files 
  systemd-tmpfiles-setup.service        loaded active exited  Create User's Volatile Files and Directories 
  wireplumber.service                   loaded active running Multimedia Service Session Manager 
  xdg-desktop-portal-gtk.service        loaded active running Portal service (GTK/GNOME implementation) 
  xdg-desktop-portal.service            loaded active running Portal service 
  xdg-document-portal.service           loaded active running flatpak document portal service 
  xdg-permission-store.service          loaded active running sandboxed app permission store 

LOAD   = Reflects whether the unit definition was properly loaded. 
ACTIVE = The high-level unit activation state, i.e. generalization of SUB. 
SUB    = The low-level unit activation state, values depend on unit type. 
**17 loaded units listed.** Pass --all to see loaded but inactive units, too. 
To show all installed unit files use 'systemctl list-unit-files'. 
karl@erlangen:~> 

Searching journal:

karl@erlangen:~> journalctl -q -b -g at-spi-dbus-bus.service 
Apr 04 05:17:23 erlangen dbus-daemon[1213]: [session uid=1000 pid=1213] Activating via systemd: service name='org.a11y.Bus' unit='at-spi-dbus-bus.service' requested by ':1.62' (uid=1000 pid=2112 comm="/usr/libexec/xdg-desktop-portal-gtk") 
karl@erlangen:~> 
karl@erlangen:~> journalctl -q -b --identifier at-spi-bus-launcher     
Apr 04 05:17:23 erlangen at-spi-bus-launcher[2121]: dbus-daemon[2121]: Activating service name='org.a11y.atspi.Registry' requested by ':1.0' (uid=1000 pid=21>
Apr 04 05:17:23 erlangen at-spi-bus-launcher[2121]: dbus-daemon[2121]: Successfully activated service 'org.a11y.atspi.Registry' 
Apr 04 05:17:23 erlangen at-spi-bus-launcher[2124]: SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry 
karl@erlangen:~> 

Thanks for your valuable comments and advice.

@tckosvic:
I’m pretty sure my system is not just slow to shut down, it really hangs; the longest time I managed to wait was 45 minutes.

@tpe and @karlmistelberger:
No system messages containing the string ‘timeout’ appear in the log file:


journalctl -b -1 -g timeout  
-- No entries --

It turns out that shutdown runs through when initiating it from another user account.
Thus, as a work around I first end the session with ‘Log Out’ and then initiate ‘Shut Down’
from the ‘greeter’ display.

I was hoping for a shut down analysis tool similar to


systemd-analyze blame

However, according to https://systemd-devel.freedesktop.narkive.com/YlYK9aqL/systemd-analyze-for-shutdown
this functionality is not (yet?) implemented.

Run as root. By the way:

**erlangen:~ #** journalctl -b -1 -u init.scope -g Stopped -o short-monotonic --no-hostname --no-pager  
    2.298018] systemd[1]: Stopped target Initrd Default Target. 
    2.298051] systemd[1]: Stopped target Basic System. 
    2.298122] systemd[1]: Stopped target Initrd Root Device. 
    2.298148] systemd[1]: Stopped target Initrd /usr File System. 
    2.298212] systemd[1]: Stopped target Path Units. 
    2.298350] systemd[1]: Stopped Dispatch Password Requests to Console Directory Watch. 
    2.298421] systemd[1]: Stopped target Remote File Systems. 
    2.298449] systemd[1]: Stopped target Preparation for Remote File Systems. 
    2.298521] systemd[1]: Stopped target Slice Units. 
    2.298547] systemd[1]: Stopped target Socket Units. 
    2.298585] systemd[1]: Stopped target System Initialization. 
    2.298633] systemd[1]: Stopped target Swaps. 
    2.298677] systemd[1]: Stopped target Timer Units. 
    2.298780] systemd[1]: Stopped dracut initqueue hook. 
    2.299565] systemd[1]: Stopped Apply Kernel Variables. 
    2.299708] systemd[1]: Stopped Load Kernel Modules. 
    2.299831] systemd[1]: Stopped Create Volatile Files and Directories. 
    2.299911] systemd[1]: Stopped target Local File Systems. 
    2.300003] systemd[1]: Stopped Coldplug All udev Devices. 
    2.302561] systemd[1]: Stopped Rule-based Manager for Device Events and Files. 
    2.303327] systemd[1]: Stopped dracut pre-udev hook. 
    2.303396] systemd[1]: Stopped dracut cmdline hook. 
    2.303428] systemd[1]: Stopped dracut ask for additional cmdline parameters. 
    2.303980] systemd[1]: Stopped Create Static Device Nodes in /dev. 
    2.304063] systemd[1]: Stopped Create List of Static Device Nodes. 
   43.821277] systemd[1]: Stopped User Manager for UID 477. 
   43.829724] systemd[1]: Stopped User Runtime Directory /run/user/477. 
  141.640152] systemd[1]: Stopped target Sleep. 
  141.640336] systemd[1]: Stopped target Suspend. 
 1332.880406] systemd[1]: Stopped target Sleep. 
 1332.880508] systemd[1]: Stopped target Suspend. 
 **3712.51**7650] systemd[1]: Stopped target Graphical Interface. 
 3712.517741] systemd[1]: Stopped target Multi-User System. 
 3712.517817] systemd[1]: Stopped target Login Prompts. 
 3712.518221] systemd[1]: Stopped target Sound Card. 
 3712.518402] systemd[1]: Stopped target Timer Units. 
 3712.518560] systemd[1]: Stopped Backup of /home. 
 3712.518681] systemd[1]: Stopped Backup of RPM database. 
 3712.518789] systemd[1]: Stopped Backup of /etc/sysconfig. 
 3712.518901] systemd[1]: Stopped Balance block groups on a btrfs filesystem. 
 3712.519005] systemd[1]: Stopped Scrub btrfs filesystem, verify block checksums. 
 3712.519101] systemd[1]: Stopped Check if mainboard battery is Ok. 
 3712.519213] systemd[1]: Stopped Discard unused blocks once a week. 
 3712.519316] systemd[1]: Stopped Daily rotation of log files. 
 3712.519452] systemd[1]: Stopped Daily man-db regeneration. 
 3712.519567] systemd[1]: Stopped Daily locate database update. 
 3712.519664] systemd[1]: Stopped Systemd timer to update the system daily with PackageKit. 
 3712.519767] systemd[1]: Stopped Daily Cleanup of Snapper Snapshots. 
 3712.519870] systemd[1]: Stopped Daily Cleanup of Temporary Directories. 
 3712.523083] systemd[1]: Stopped auditd rules generation. 
 3712.536971] systemd[1]: Stopped Apply settings from /etc/sysconfig/keyboard. 
 3712.541409] systemd[1]: Stopped hd-idle disk spindown service. 
 3712.541561] systemd[1]: Stopped irqbalance daemon. 
 3712.541805] systemd[1]: Stopped CUPS Scheduler. 
 3712.542267] systemd[1]: Stopped Machine Check Exception Logging Daemon. 
 3712.542709] systemd[1]: Stopped Getty on tty1. 
 3712.543161] systemd[1]: Stopped Command Scheduler. 
 3712.543670] systemd[1]: Stopped A remote-mail retrieval utility. 
 3712.544646] systemd[1]: Stopped Save/Restore Sound Card State. 
 3712.545054] systemd[1]: Stopped Restore /run/initramfs on shutdown. 
 3712.545766] systemd[1]: Stopped Load/Save Random Seed. 
 3712.548985] systemd[1]: Stopped Start fetchmail. 
 3712.549151] systemd[1]: Stopped Hold until boot process finishes up. 
 3712.550232] systemd[1]: Stopped Authorization Manager. 
 3712.556084] systemd[1]: Stopped MiniDLNA is a DLNA/UPnP-AV server software. 
 3712.557294] systemd[1]: Stopped target Network is Online. 
 3712.560834] systemd[1]: Stopped Disk Manager. 
 3712.584734] systemd[1]: Stopped RealtimeKit Scheduling Policy Service. 
 3712.591528] systemd[1]: Stopped Session 2 of User karl. 
 3712.628433] systemd[1]: Stopped Postfix Mail Transport Agent. 
 3712.717217] systemd[1]: Stopped Daemon for power management. 
 3712.961805] systemd[1]: Stopped User Manager for UID 1000. 
 3712.993942] systemd[1]: Stopped User Runtime Directory /run/user/1000. 
 3713.033308] systemd[1]: Stopped D-Bus System Message Bus. 
 3713.838720] systemd[1]: Stopped X Display Manager. 
 3713.844916] systemd[1]: Stopped Permit User Sessions. 
 3713.900906] systemd[1]: Stopped User Login Management. 
 3713.907005] systemd[1]: Stopped The Apache Webserver. 
 3713.907128] systemd[1]: Stopped target Remote File Systems. 
 3713.907194] systemd[1]: Stopped target System Time Synchronized. 
 3713.907246] systemd[1]: Stopped target System Time Set. 
 3713.908090] systemd[1]: Stopped NTP client/server. 
 3713.908229] systemd[1]: Stopped target Basic System. 
 3713.908304] systemd[1]: Stopped target Network. 
 3713.908355] systemd[1]: Stopped target Host and Network Name Lookups. 
 3713.908435] systemd[1]: Stopped target Path Units. 
 3713.924339] systemd[1]: Stopped Watch /etc/sysconfig/btrfsmaintenance. 
 3713.976363] systemd[1]: Stopped Watch for changes in CA certificates. 
 3713.976820] systemd[1]: Stopped CUPS Scheduler. 
 3714.008349] systemd[1]: Stopped Watch for changes in issue snippets. 
 3714.024343] systemd[1]: Stopped Watch for changes in smartmontools sysconfig file. 
 3714.024630] systemd[1]: Stopped target Slice Units. 
 3714.025230] systemd[1]: Stopped target Socket Units. 
 3714.026367] systemd[1]: Stopped target System Initialization. 
 3714.026923] systemd[1]: Stopped target Local Encrypted Volumes. 
 3714.040356] systemd[1]: Stopped Dispatch Password Requests to Console Directory Watch. 
 3714.040618] systemd[1]: Stopped target Local Integrity Protected Volumes. 
 3714.040815] systemd[1]: Stopped target Local Verity Protected Volumes. 
 3714.049748] systemd[1]: Stopped Record System Boot/Shutdown in UTMP. 
 3714.057211] systemd[1]: Stopped Network Name Resolution. 
 3714.104507] systemd[1]: Stopped Network Configuration. 
 3714.106271] systemd[1]: Stopped Apply Kernel Variables. 
 3714.106611] systemd[1]: Stopped Apply Kernel Variables for 5.17.1-1-default. 
 3714.106982] systemd[1]: Stopped Load Kernel Modules. 
 3714.154044] systemd[1]: Stopped Security Auditing Service. 
 3714.154229] systemd[1]: Stopped Create Volatile Files and Directories. 
 3714.154268] systemd[1]: Stopped target Local File Systems. 
 **3714.16**3097] systemd[1]: Stopped target Swaps. 
**erlangen:~ #**

erlangen shutdown completes in 3714.16 - 3712.51 = 1.65 seconds.

I agree >45 minutes is a “hang” not a long shutdown.

I’ve started other threads on the subject of long shutdowns and also starts…

https://forums.opensuse.org/showthread.php/565739-Extremely-long-shutdown-time-in-a-restart?highlight=shutdown
https://forums.opensuse.org/showthread.php/564763-mlocate-s-major-factor-in-long-boots-and-shutdowns?highlight=shutdown
https://forums.opensuse.org/showthread.php/554047-After-nvidia-display-driver-install-long-boot-times-(minutes)?highlight=shutdown

There were many suggestions in using systemd functions included in these threads that might help in diagnosis.

tom kosvic

@geeb497:

Have you checked the following?

  • The amount of free space available for ‘/var/log/journal/
    ’ ? - The amount of directory space currently being used by the systemd Journal?

 # journalctl --disk-usage
 # du -hs /var/log/journal/

  • If the ‘/var/
    ’ partition is located on a Btrfs filesystem, has the Btrfs housekeeping (“balance” and “scrub”) been done? - Given that the system’s user seems to use KDE Plasma, when that user logs out from the KDE Plasma session, are there any residual user processes related to that user still executing?
    Despite setting up “KillOnlyUsers=” in ‘/etc/systemd/logind.conf’, periodically some user processes related to a logged out KDE Plasma user session are still running when I hit the “power-off” button.

systemd typically waits about 1 minute and a few seconds before any residual user processes are killed by the systemd power-off sequence.