Very slow reboot or shutdown

Here is the section of “shutdown.txt” that seems to apply to the same shutdown delay. It appears to be quite similar to the last:



 3626.856332] systemd-cryptsetup[8483]: Allocating crypt device context by device 10T.
 3626.856338] systemd-cryptsetup[8483]: Initialising device-mapper backend library.
 3626.856422] systemd-cryptsetup[8483]: dm version    opencount flush ]   [16384] (*1)
 3626.856431] systemd-cryptsetup[8483]: dm versions    opencount flush ]   [16384] (*1)
 3626.856439] systemd-cryptsetup[8483]: Detected dm-ioctl version 4.42.0.
 3626.856441] systemd-cryptsetup[8483]: Detected dm-crypt version 1.22.0.
 3626.856455] systemd-cryptsetup[8483]: Device-mapper backend running with UDEV support enabled.
 3626.856461] systemd-cryptsetup[8483]: dm status 10T   opencount noflush ]   [16384] (*1)
 3626.856468] systemd-cryptsetup[8483]: Releasing device-mapper backend.
 3626.856495] systemd-cryptsetup[8483]: Trying to open and read device /dev/sdb1 with direct-io.
 3626.856791] systemd-journald[918]: Successfully sent stream file descriptor to service manager.
 3626.858575] systemd-cryptsetup[8487]: Allocating crypt device context by device 04T.
 3626.858580] systemd-cryptsetup[8487]: Initialising device-mapper backend library.
 3626.858655] systemd-cryptsetup[8487]: dm version    opencount flush ]   [16384] (*1)
 3626.858663] systemd-cryptsetup[8487]: dm versions    opencount flush ]   [16384] (*1)
 3626.858670] systemd-cryptsetup[8487]: Detected dm-ioctl version 4.42.0.
 3626.858672] systemd-cryptsetup[8487]: Detected dm-crypt version 1.22.0.
 3626.858684] systemd-cryptsetup[8487]: Device-mapper backend running with UDEV support enabled.
 3626.858689] systemd-cryptsetup[8487]: dm status 04T   opencount noflush ]   [16384] (*1)
 3626.858697] systemd-cryptsetup[8487]: Releasing device-mapper backend.
 3626.858721] systemd-cryptsetup[8487]: Trying to open and read device /dev/sdc1 with direct-io.
 3626.866311] systemd-cryptsetup[8483]: Allocating context for crypt device /dev/sdb1.
 3626.866315] systemd-cryptsetup[8483]: Trying to open and read device /dev/sdb1 with direct-io.
 3626.866541] systemd-cryptsetup[8483]: Initialising device-mapper backend library.
 3626.866557] systemd-cryptsetup[8483]: dm versions    opencount flush ]   [16384] (*1)
 3626.866575] systemd-cryptsetup[8483]: dm table 10T   opencount flush securedata ]   [16384] (*1)
 3626.866594] systemd-cryptsetup[8483]: Trying to open and read device /dev/sdb1 with direct-io.
 3626.866765] systemd-cryptsetup[8483]: dm versions    opencount flush ]   [16384] (*1)
 3626.866773] systemd-cryptsetup[8483]: dm deps 10T   opencount flush ]   [16384] (*1)
 3626.866797] systemd-cryptsetup[8483]: Crypto backend (OpenSSL 1.1.1d  10 Sep 2019) initialized in cryptsetup library version 2.3.4.
 3626.866800] systemd-cryptsetup[8483]: Detected kernel Linux 5.3.18-59.16-default x86_64.
 3626.867014] systemd-cryptsetup[8483]: PBKDF pbkdf2-sha256, time_ms 2000 (iterations 0).
 3626.867017] systemd-cryptsetup[8483]: Reading LUKS header of size 1024 from device /dev/sdb1
 3626.867179] systemd-cryptsetup[8483]: Key length 32, device size 19532871647 sectors, header size 2050 sectors.
 3626.867185] systemd-cryptsetup[8483]: Deactivating volume 10T.
 3626.867193] systemd-cryptsetup[8483]: dm versions    opencount flush ]   [16384] (*1)
 3626.867203] systemd-cryptsetup[8483]: dm status 10T   opencount noflush ]   [16384] (*1)
 3626.867211] systemd-cryptsetup[8483]: dm versions    opencount flush ]   [16384] (*1)
 3626.867217] systemd-cryptsetup[8483]: dm table 10T   opencount flush securedata ]   [16384] (*1)
 3626.867234] systemd-cryptsetup[8483]: Trying to open and read device /dev/sdb1 with direct-io.
 3626.867488] systemd-cryptsetup[8487]: Allocating context for crypt device /dev/sdc1.
 3626.867493] systemd-cryptsetup[8487]: Trying to open and read device /dev/sdc1 with direct-io.
 3626.867587] systemd-cryptsetup[8487]: Initialising device-mapper backend library.
 3626.867602] systemd-cryptsetup[8487]: dm versions    opencount flush ]   [16384] (*1)
 3626.867609] systemd-cryptsetup[8483]: dm versions    opencount flush ]   [16384] (*1)
 3626.867618] systemd-cryptsetup[8487]: dm table 04T   opencount flush securedata ]   [16384] (*1)
 3626.867631] systemd-cryptsetup[8483]: Udev cookie 0xd4d6101 (semid 21) created
 3626.867635] systemd-cryptsetup[8483]: Udev cookie 0xd4d6101 (semid 21) incremented to 1
 3626.867641] systemd-cryptsetup[8487]: Trying to open and read device /dev/sdc1 with direct-io.
 3626.867641] systemd-cryptsetup[8483]: Udev cookie 0xd4d6101 (semid 21) incremented to 2
 3626.867647] systemd-cryptsetup[8483]: Udev cookie 0xd4d6101 (semid 21) assigned to REMOVE task(2) with flags DISABLE_LIBRARY_FALLBACK         (0x20)
 3626.867652] systemd-cryptsetup[8483]: dm remove 10T   opencount flush retryremove ]   [16384] (*1)
 3626.867731] systemd-cryptsetup[8487]: dm versions    opencount flush ]   [16384] (*1)
 3626.867740] systemd-cryptsetup[8487]: dm deps 04T   opencount flush ]   [16384] (*1)
 3626.867764] systemd-cryptsetup[8487]: Crypto backend (OpenSSL 1.1.1d  10 Sep 2019) initialized in cryptsetup library version 2.3.4.
 3626.867767] systemd-cryptsetup[8487]: Detected kernel Linux 5.3.18-59.16-default x86_64.
 3626.867901] systemd-cryptsetup[8487]: PBKDF pbkdf2-sha256, time_ms 2000 (iterations 0).
 3626.867904] systemd-cryptsetup[8487]: Reading LUKS header of size 1024 from device /dev/sdc1
 3626.867989] systemd-cryptsetup[8487]: Key length 32, device size 7814033408 sectors, header size 2050 sectors.
 3626.867995] systemd-cryptsetup[8487]: Deactivating volume 04T.
 3626.868002] systemd-cryptsetup[8487]: dm versions    opencount flush ]   [16384] (*1)
 3626.868011] systemd-cryptsetup[8487]: dm status 04T   opencount noflush ]   [16384] (*1)
 3626.868018] systemd-cryptsetup[8487]: dm versions    opencount flush ]   [16384] (*1)
 3626.868024] systemd-cryptsetup[8487]: dm table 04T   opencount flush securedata ]   [16384] (*1)
 3626.868046] systemd-cryptsetup[8487]: Trying to open and read device /dev/sdc1 with direct-io.
 3626.868319] systemd-cryptsetup[8487]: dm versions    opencount flush ]   [16384] (*1)
 3626.868336] systemd-cryptsetup[8487]: Udev cookie 0xd4d0a39 (semid 22) created
 3626.868340] systemd-cryptsetup[8487]: Udev cookie 0xd4d0a39 (semid 22) incremented to 1
 3626.868345] systemd-cryptsetup[8487]: Udev cookie 0xd4d0a39 (semid 22) incremented to 2
 3626.868350] systemd-cryptsetup[8487]: Udev cookie 0xd4d0a39 (semid 22) assigned to REMOVE task(2) with flags DISABLE_LIBRARY_FALLBACK         (0x20)
 3626.868354] systemd-cryptsetup[8487]: dm remove 04T   opencount flush retryremove ]   [16384] (*1)
 3626.874472] systemd-journald[918]: Successfully sent stream file descriptor to service manager.
 3626.896108] systemd-cryptsetup[8483]: Udev cookie 0xd4d6101 (semid 21) decremented to 0
 3626.896112] systemd-cryptsetup[8483]: Udev cookie 0xd4d6101 (semid 21) waiting for zero
 3626.896118] systemd-cryptsetup[8487]: Udev cookie 0xd4d0a39 (semid 22) decremented to 0
 3626.896118] systemd-cryptsetup[8483]: Udev cookie 0xd4d6101 (semid 21) destroyed
 3626.896123] systemd-cryptsetup[8487]: Udev cookie 0xd4d0a39 (semid 22) waiting for zero
 3626.896128] systemd-cryptsetup[8483]: Releasing crypt device /dev/sdb1 context.
 3626.896128] systemd-cryptsetup[8487]: Udev cookie 0xd4d0a39 (semid 22) destroyed
 3626.896131] systemd-cryptsetup[8483]: Releasing device-mapper backend.
 3626.896136] systemd-cryptsetup[8487]: Releasing crypt device /dev/sdc1 context.
 3626.896137] systemd-cryptsetup[8483]: Closing read only fd for /dev/sdb1.
 3626.896138] systemd-cryptsetup[8487]: Releasing device-mapper backend.
 3626.896143] systemd-cryptsetup[8487]: Closing read only fd for /dev/sdc1.
 3628.294243] systemd-journald[918]: Successfully sent stream file descriptor to service manager.
 3628.296834] systemd-journald[918]: Successfully sent stream file descriptor to service manager.
 3656.810168] systemd[1]: systemd-logind.service: Got notification message from PID 1428 (WATCHDOG=1)
 3716.810040] systemd[1]: session-2.scope: Stopping timed out. Killing.
 3716.810192] systemd[1]: session-2.scope: Killing process 3095 (kdesud) with signal SIGKILL.
 3716.810250] systemd[1]: session-2.scope: Failed with result 'timeout'.
 3716.810257] systemd[1]: session-2.scope changed stop-sigterm -> failed

For what it’s worth, this seems to be a KDE bug of some kind. I have 5 machines displaying the same behavior at almost every shutdown. I changed my primary machine to the Mate desktop and the problem seems to have disappeared. The only default KDE settings that I modify is that I use an image from my home folder for wallpaper, lock screen, and login screen. I cannot think of anything else unusual with any of my settings.

this seems to be a KDE bug of some kind

To me it seems so too. When you reboot/shutdown from the login screen directly, before logging into KDE session, the shutdown is immediate. But after logging into a KDE session first, the shutdown delay occurs. (I have not tried what happens if I do a logout first, then a shutdown).

But for me there seems to be a failing /var unmount happening, which might be very vell related. I don’t see any waiting tasks that would be taking up time.

For reference, KDE on Ubuntu Studio does not have a similar issue. But I am not sure could this difference be due to different filesystem types or what.

This is a 2 year old thread you should start a new one for your problems

For what it’s worth, the problem has existed since openSUSE 12* and I made multiple threads concerning it over the years. I receive multiple troubleshooting suggestions which turn up nothing notable, and then silence or sarcasm after I post the results. I wrote it off as something that no one can figure out and that speculative questioning is unwelcome. Tumbleweed does seem to do better. I get the delay approximately 10% of the time.

@purevw You should start a new thread if you are having an issue, if you do post the output from systemd-analyze that should isolate where the issue may be…

Note: Closing Thread.