Shutdown takes a lot of time

Hi.
I got a problem with shutting down my and my father’s laptop, both running Leap 15.1. The laptops are more or less the same so for now I’m trying to fix this on my laptop.

When I try to reboot or shutdown my laptop it would stop on Reached target Shutdown. I didn’t measure the time it takes but I guess it’s about 1:30 minutes like most of the timeouts.

Here’s some data, I don’t know what can I provide to help more with diagnosis.

filip@norm16:~> sudo journalctl -b -1 -n 100
-- Logs begin at Mon 2019-08-19 12:35:39 CEST, end at Mon 2019-08-19 13:14:12 CEST. --
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped Forward Password Requests to Plymouth Directory Watch.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped target Slices.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Removed slice User and Session Slice.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped target Sockets.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Closed Syslog Socket.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Closed CUPS Scheduler.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Closed D-Bus System Message Bus Socket.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Closed Open-iSCSI iscsid Socket.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Closed PC/SC Smart Card Daemon Activation Socket.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Closed Avahi mDNS/DNS-SD Stack Activation Socket.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped target Paths.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped Watch /etc/sysconfig/btrfsmaintenance.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped CUPS Scheduler.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped Watch for changes in CA certificates.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped target System Initialization.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped target Encrypted Volumes.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopping Cryptography Setup for cr-auto-2...
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopping Cryptography Setup for cr-auto-1...
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopping Load/Save Screen Backlight Brightness of backlight:intel_backlight...
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped target Swap.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Deactivating swap /dev/dm-1...
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopping Update UTMP about System Boot/Shutdown...
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopping Load/Save Random Seed...
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped Apply Kernel Variables.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped Load Kernel Modules.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped Load/Save Screen Backlight Brightness of backlight:intel_backlight.
sie 19 13:07:49 norm16.nordprim.local systemd-cryptsetup[7968]: Failed to deactivate: Device or resource busy
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped Load/Save Random Seed.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: systemd-cryptsetup@cr\x2dauto\x2d1.service: Control process exited, code=exited status=1
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped Cryptography Setup for cr-auto-1.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: systemd-cryptsetup@cr\x2dauto\x2d1.service: Unit entered failed state.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: systemd-cryptsetup@cr\x2dauto\x2d1.service: Failed with result 'exit-code'.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Removed slice system-systemd\x2dbacklight.slice.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped Update UTMP about System Boot/Shutdown.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopping Security Auditing Service...
sie 19 13:07:49 norm16.nordprim.local systemd-cryptsetup[7967]: Failed to deactivate: Device or resource busy
sie 19 13:07:49 norm16.nordprim.local auditd[2304]: The audit daemon is exiting.
sie 19 13:07:49 norm16.nordprim.local auditd[2304]: Error setting audit daemon pid (Invalid argument)
sie 19 13:07:49 norm16.nordprim.local systemd[1]: systemd-cryptsetup@cr\x2dauto\x2d2.service: Control process exited, code=exited status=1
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped Cryptography Setup for cr-auto-2.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: systemd-cryptsetup@cr\x2dauto\x2d2.service: Unit entered failed state.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: systemd-cryptsetup@cr\x2dauto\x2d2.service: Failed with result 'exit-code'.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped Security Auditing Service.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped Create Volatile Files and Directories.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped Flush Journal to Persistent Storage.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped target Local File Systems.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Unmounting /.snapshots...
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Unmounting /usr/local...
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Unmounting /data...
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Unmounting /opt...
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Unmounting /var...
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Unmounting /tmp...
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Unmounting /srv...
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Unmounting /boot/efi...
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Unmounting /home...
sie 19 13:07:49 norm16.nordprim.local kernel: XFS (dm-5): Unmounting Filesystem
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Unmounting /root...
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Removed slice system-systemd\x2dcryptsetup.slice.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Deactivated swap /dev/mapper/linux-swap.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Deactivated swap /dev/disk/by-uuid/4335f6d8-11ee-4eba-9acb-ccea6845d305.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Deactivated swap /dev/disk/by-id/dm-uuid-LVM-3eHeeaH6aIvf3zb3C8SplHfGva9ZdnAQoCLwUwaangOVlh8niU7q4U8uYQqVCsg5.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Deactivated swap /dev/disk/by-id/dm-name-linux-swap.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Deactivated swap /dev/dm-1.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Deactivated swap /dev/linux/swap.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Unmounted /.snapshots.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Unmounted /usr/local.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Unmounted /opt.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: var.mount: Mount process exited, code=exited status=32
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Failed unmounting /var.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: tmp.mount: Mount process exited, code=exited status=32
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Failed unmounting /tmp.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Unmounted /srv.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Unmounted /boot/efi.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: home.mount: Mount process exited, code=exited status=32
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Failed unmounting /home.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Unmounted /root.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Unmounting /boot...
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Unmounted /boot.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped File System Check on /dev/disk/by-uuid/69f4a8f6-e782-4600-8175-89182ebbeb90.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Removed slice system-systemd\x2dfsck.slice.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Unmounted /data.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Reached target Unmount All Filesystems.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped target Local File Systems (Pre).
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped Remount Root and Kernel File Systems.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped Create Static Device Nodes in /dev.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopping Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling...
sie 19 13:07:49 norm16.nordprim.local lvm[7987]:   1 logical volume(s) in volume group "dane" unmonitored
sie 19 13:07:49 norm16.nordprim.local lvm[7987]:   3 logical volume(s) in volume group "linux" unmonitored
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopping LVM2 metadata daemon...
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped LVM2 metadata daemon.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Reached target Shutdown.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Reached target Final Step.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Starting Reboot...
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Closed LVM2 metadata daemon socket.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Shutting down.
sie 19 13:07:49 norm16.nordprim.local systemd-shutdown[1]: Sending SIGTERM to remaining processes...
sie 19 13:07:49 norm16.nordprim.local haveged[1177]: haveged: Stopping due to signal 15
sie 19 13:07:49 norm16.nordprim.local haveged[1177]: haveged starting up
sie 19 13:07:49 norm16.nordprim.local systemd-journald[7151]: Journal stopped

I’m using lvm volumes for encryption:
/boot - not encrypted
/boot/efi - not encrypted
/, /home, swap - encrypted LVM #1
/data - encrypted LVM#2

If you are seeing the plymouth screen during shutdown, then try hitting ESC to see more information. That might give you a hint on what is the problem.

Hi flipk, I have the same problem, I started this thread
https://forums.opensuse.org/showthread.php/537027-reached-target-shutdown-for-2minutes-when-shutdown?p=2911902#post2911902
in the last post I followed some instructions in the link in the post, I’m a newby and you are surely more clever than me so you can get some more informations from that procedure and compare.
ciao, :slight_smile:

This bug is also present in Kubuntu 19.10 (Kconfig 5.60-5.61) and TW because of a stop job running as seen when clicking ESC.

The service responsible of this is the Printer in our case (not connected + no driver installed). Here’s the bug fix in System Settings :

  1. Startup and Shutdown>Background Services>Print Manager>Deselect
  2. Startup and Shutdown>Desktop Session>On Login>Start with an empty session>Select

This bug is also present upon restart after compiling mainline Kernel and the solution consist in disabling all background services except 2:

  1. Application menus daemon
  2. Network Status

The best we were able to do. The restart issue is not present in Kubuntu (ext4). In all cases, this is not a funny long lasting KDE issue to deal with.

Note: Disabling services does not affect desktop stability here.

I’m aware of that and I gave you result from previous shutting down in my original post. It would stop on Reached target Shutdown and won’t give anymore details.

This bug is also present in Kubuntu 19.10 (Kconfig 5.60-5.61) and TW because of a stop job running as seen when clicking ESC.

The service responsible of this is the Printer in our case (not connected + no driver installed). Here’s the bug fix in System Settings :

  1. Startup and Shutdown>Background Services>Print Manager>Deselect
  2. Startup and Shutdown>Desktop Session>On Login>Start with an empty session>Select

Unfortunately it’s not working for me. I guess my problem is different.

Hi flipk, I have the same problem, I started this thread
https://forums.opensuse.org/showthre…02#post2911902
in the last post I followed some instructions in the link in the post, I’m a newby and you are surely more clever than me so you can get some more informations from that procedure and compare.

I will try to look into that.

[QUOTE]Hi flipk, I have the same problem, I started this thread
https://forums.opensuse.org/showthre…02#post2911902
in the last post I followed some instructions in the link in the post, I’m a newby and you are surely more clever than me so you can get some more informations from that procedure and compare.

I will try to look into that.[/QUOTE]

Unfortunately, my problem is different. I do have btrfs partitions and I have LVM and I’m not willing to get rid of it.

We were able to isolate the 1m30sec delay for restart and we are not able to reproduce the shutdown delay anymore.

In the Kubuntu ee installer(20190821), on the first restart, there are two stop jobs running:

  1. CUPS Printer
  2. A stop job is running for session c1 of user Kubuntu

The first one is easy to isolate, the second one took 10 fresh installs back to back and seems to be related to the network switch.

If we boot in try Ubuntu and turn off the print manager service + if we set the network switch to Air Plane Mode it works with no delay. The machine restart and shutdown normally.

Same applies for compiling anything higher than stock kernel. No delay! All other services are default except the printer one. Disabling the network switch when we shutdown or restart fixes it.

For TW, disabling network (air plane mode) after enabling the mainline Kernel repo produces the same effect, no delay.
Other factors to consider, wrong BIOS clock and/or restart from the terminal. The machine is dual boot with Ten.

What do you see when pressing ESC?

There was a long mouse hesitation in the previous filth release candidate that seems to be gone. No such thing in 19.10 for -rc5. After the fresh install, mute system sound is not shown.

Multimedia>Audio Volume>Applications>Notification sounds>Empty. Back to normal after dup.

Oh my god. I told you - it’s in my first post!!! It stops on Reached target Shutdown and actually shuts down in about 90 seconds. No more info

Only helpful things I think are there are


sie 19 13:07:49 norm16.nordprim.local systemd[1]: var.mount: Mount process exited, code=exited status=32
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Failed unmounting /var.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: tmp.mount: Mount process exited, code=exited status=32
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Failed unmounting /tmp.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: home.mount: Mount process exited, code=exited status=32
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Failed unmounting /home.

And


systemd-cryptsetup[7967]: Failed to deactivate: Device or resource busy
sie 19 13:07:49 norm16.nordprim.local auditd[2304]: The audit daemon is exiting.
sie 19 13:07:49 norm16.nordprim.local auditd[2304]: Error setting audit daemon pid (Invalid argument)
sie 19 13:07:49 norm16.nordprim.local systemd[1]: systemd-cryptsetup@cr\x2dauto\x2d2.service: Control process exited, code=exited status=1
sie 19 13:07:49 norm16.nordprim.local systemd[1]: Stopped Cryptography Setup for cr-auto-2.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: systemd-cryptsetup@cr\x2dauto\x2d2.service: Unit entered failed state.
sie 19 13:07:49 norm16.nordprim.local systemd[1]: systemd-cryptsetup@cr\x2dauto\x2d2.service: Failed with result 'exit-code'.

Just a general comment.

I saw similar shutdown problems on one computer, maybe two weeks ago. But it has not repeated.

After seeing the “failed to umount” messages, I then booted that computer from a USB and ran “fsck” on the file systems. And, indeed, some had not been shutdown properly.

The particular computer was a laptop. There had been a power outage, and the laptop went into sleep mode (suspend to memory) during the outage. That’s about the only thing different from normal usage. But I don’t know if it is related.

Oh, and I use “ext4” on that system.

On a different system – actually a virtual machine – where I am using “btrfs”, I always see “failed to unmount /var” on shutdown. That seems to be a common problem for people using “btrfs” and there is an open bug report on it.

Yesterday, I saw a “fail to unmount swap” on one system. I don’t worry about swap corruption. But I am using randomly encrypted swap on that system, and saw similar messages to what you show. I’m not sure if that happens at every shutdown. It is actually a test virtual machine running the alpha release of Leap 15.2.

This comment probably doesn’t help you. I have been following the thread but I have not seen anything that I recognize as the cause of your problem.

Just made a fresh install with a separate LVM home partition, the delay is not present.

lsblk
NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda               8:0    0 238.5G  0 disk 
├─sda1            8:1    0   529M  0 part 
├─sda2            8:2    0   100M  0 part 
├─sda3            8:3    0    16M  0 part 
├─sda4            8:4    0 135.9G  0 part 
├─sda5            8:5    0   500M  0 part /boot/efi
└─sda6            8:6    0 101.5G  0 part 
  ├─system-root 254:0    0  43.2G  0 lvm  /tmp
  ├─system-swap 254:1    0     2G  0 lvm  [SWAP]
  └─system-home 254:2    0  56.3G  0 lvm  /home
lsb_release -a && uname -r
LSB Version:    n/a
Distributor ID: openSUSE
Description:    openSUSE Tumbleweed
Release:        20190815
Codename:       n/a
5.2.8-1-default

Wiil now try LVM encrypted and report back…

Not able to reproduce the bug, no delay for shutdown and restart. Only Print manager is off and with an active network switch, no delay either.

  lsblk
NAME                                              MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                                                 8:0    0 238.5G  0 disk  
├─sda1                                              8:1    0   529M  0 part  
├─sda2                                              8:2    0   100M  0 part  
├─sda3                                              8:3    0    16M  0 part  
├─sda4                                              8:4    0 135.9G  0 part  
├─sda5                                              8:5    0   500M  0 part  /boot/efi
└─sda6                                              8:6    0 101.5G  0 part  
  └─cr_ata-SanDisk_SDSSDH3256G_183756420226-part6 254:0    0 101.5G  0 crypt 
    ├─system-root                                 254:1    0  41.4G  0 lvm   /root
    ├─system-swap                                 254:2    0   7.4G  0 lvm   [SWAP]
    └─system-home                                 254:3    0  52.7G  0 lvm   /home

Regards,

I think I found the reason with help of another issue I was trying to resolve.

I got kadu installed and set up to start on login but most of the time it wouldn’t start on login and also I was unable to start it even from CLI (no output there). Yesterday I started digging into it and I noticed that MEGAsync have the same issue but it actually did give me some output when tried to start from CLI:

(megasync:7185): Gtk-WARNING **: Nie można odnaleźć modułu obsługującego motyw w module_path: „murrine”,
Setting QT_SCREEN_SCALE_FACTORS= "DVI-I-1-1=1;DVI-I-2-2=1;eDP-1=1"

Doesn’t look very much helpful but I decided to check if there is a process running for both MEGAsync and kadu and there was. Wouldn’t die with regular kill but it did when I used signal 9. After successfully killing it, it would start normally and it also seems that shutting down goes normally too.

Now the question is why those two apps are not always starting properly on login?
I’m thinking that my docking station at work (to which I got 2x 2K displays connected) may be the reason. It’s very common that when I start my laptop it wouldn’t automatically login (which is set to do so because I got whole disk encrypted).

I will try to dig into all that and give you feedback if I find anything but you’re welcome to post your suggestions on what can I try to do.

Logs after kscreen_backend_launcher:

sie 27 07:41:41 norm16.nordprim.local kdeinit5[4368]: The X11 connection broke: I/O error (code 1)
sie 27 07:41:41 norm16.nordprim.local kuiserver5[4674]: The X11 connection broke: I/O error (code 1)
sie 27 07:41:41 norm16.nordprim.local org.kde.kuiserver[4336]: XIO:  fatal IO error 25 (Niewłaściwy ioctl dla urządzenia) on X server ":0"
sie 27 07:41:41 norm16.nordprim.local org.kde.kuiserver[4336]:       after 410 requests (410 known processed) with 0 events remaining.
sie 27 07:41:41 norm16.nordprim.local akonadi_control[4558]: The X11 connection broke: I/O error (code 1)
sie 27 07:41:41 norm16.nordprim.local org.kde.ActivityManager[4336]: XIO:  fatal IO error 2 (Nie ma takiego pliku ani katalogu) on X server ":0"
sie 27 07:41:41 norm16.nordprim.local org.kde.ActivityManager[4336]:       after 724 requests (724 known processed) with 0 events remaining.
sie 27 07:41:41 norm16.nordprim.local kernel: evdi: [D] evdi_driver_postclose:144 (dev=2) Process tries to close us, postclose
sie 27 07:41:41 norm16.nordprim.local kernel: evdi: * Task 4153 (X) of process 4153 (X)
sie 27 07:41:41 norm16.nordprim.local kernel: show_signal_msg: 37 callbacks suppressed
sie 27 07:41:41 norm16.nordprim.local kernel: kscreen_backend[4418]: segfault at 14 ip 00007f1165849c2b sp 00007ffcf9c11380 error 4 in KSC_XRandR.so[7f1165834000+22000]
sie 27 07:41:41 norm16.nordprim.local kactivitymanagerd[4480]: The X11 connection broke: I/O error (code 1)
sie 27 07:41:41 norm16.nordprim.local ksplashqml[4344]: The X11 connection broke (error 1). Did the X11 server die?
sie 27 07:41:41 norm16.nordprim.local kactivitymanagerd[4480]: Closing SQL connection:  "kactivities_db_resources_140586905324864_readwrite"
sie 27 07:41:41 norm16.nordprim.local ksmserver[4384]: ksmserver: ksmserver: Fatal IO error: client killed
sie 27 07:41:41 norm16.nordprim.local polkit-kde-authentication-agent-1[4412]: The X11 connection broke: I/O error (code 1)
sie 27 07:41:41 norm16.nordprim.local kscreen_backend_launcher[4418]: kscreen.xrandr: Result: unknown (error)
sie 27 07:41:41 norm16.nordprim.local bluetoothd[2093]: Endpoint unregistered: sender=:1.43 path=/MediaEndpoint/A2DPSource
sie 27 07:41:41 norm16.nordprim.local org.kde.kglobalaccel[4336]: XIO:  fatal IO error 25 (Niewłaściwy ioctl dla urządzenia) on X server ":0"
sie 27 07:41:41 norm16.nordprim.local org.kde.kglobalaccel[4336]:       after 23791 requests (23791 known processed) with 0 events remaining.
sie 27 07:41:41 norm16.nordprim.local kscreen_backend_launcher[4418]: kscreen.xrandr: Output failed to be Enabled:  "DVI-I-1-1"
sie 27 07:41:41 norm16.nordprim.local bluetoothd[2093]: Endpoint unregistered: sender=:1.43 path=/MediaEndpoint/A2DPSink
sie 27 07:41:41 norm16.nordprim.local kscreen_backend_launcher[4418]: kscreen.xrandr: QMap((63, XRandRCrtc(0x5642605ac450))(64, XRandRCrtc(0x5642605a2cc0))(65, XRandRCrtc(0x5642605a2da0))(364, XRandRCrtc(0x564>
sie 27 07:41:41 norm16.nordprim.local polkitd[2174]: Unregistered Authentication Agent for unix-session:1 (system bus name :1.25, object path /org/kde/PolicyKit1/AuthenticationAgent, locale pl_PL.UTF-8) (disco>
sie 27 07:41:41 norm16.nordprim.local klauncher[4365]: The X11 connection broke: I/O error (code 1)
sie 27 07:41:41 norm16.nordprim.local kaccess[4379]: The X11 connection broke: I/O error (code 1)
sie 27 07:41:41 norm16.nordprim.local kdeconnectd[4422]: The X11 connection broke: I/O error (code 1)
sie 27 07:41:41 norm16.nordprim.local korgac[4451]: The X11 connection broke: I/O error (code 1)
sie 27 07:41:41 norm16.nordprim.local org_kde_powerdevil[4453]: The X11 connection broke: I/O error (code 1)
sie 27 07:41:41 norm16.nordprim.local xembedsniproxy[4414]: The X11 connection broke: I/O error (code 1)
sie 27 07:41:41 norm16.nordprim.local kwin_x11[4402]: The X11 connection broke: I/O error (code 1)
sie 27 07:41:41 norm16.nordprim.local krunner[4407]: The X11 connection broke: I/O error (code 1)
sie 27 07:41:41 norm16.nordprim.local kglobalaccel5[4383]: The X11 connection broke: I/O error (code 1)
sie 27 07:41:41 norm16.nordprim.local ksmserver[4384]: ksmserver: running shutdown script "/home/filip/.config/plasma-workspace/shutdown/clear-temp"
sie 27 07:41:41 norm16.nordprim.local akonadi_akonotes_resource[4684]: QSocketNotifier: Invalid socket 7 and type 'Read', disabling...
sie 27 07:41:41 norm16.nordprim.local akonadi_akonotes_resource[4684]: QSocketNotifier: Invalid socket 9 and type 'Read', disabling...
sie 27 07:41:41 norm16.nordprim.local akonadi_maildir_resource[4691]: QSocketNotifier: Invalid socket 7 and type 'Read', disabling...
sie 27 07:41:41 norm16.nordprim.local akonadi_maildir_resource[4691]: QSocketNotifier: Invalid socket 9 and type 'Read', disabling...
sie 27 07:41:41 norm16.nordprim.local akonadi_followupreminder_agent[4688]: QSocketNotifier: Invalid socket 7 and type 'Read', disabling...
sie 27 07:41:41 norm16.nordprim.local akonadi_followupreminder_agent[4688]: QSocketNotifier: Invalid socket 13 and type 'Read', disabling...
sie 27 07:41:41 norm16.nordprim.local akonadi_followupreminder_agent[4688]: QSocketNotifier: Invalid socket 9 and type 'Read', disabling...
sie 27 07:41:41 norm16.nordprim.local akonadi_contacts_resource[4687]: QSocketNotifier: Invalid socket 7 and type 'Read', disabling...
sie 27 07:41:41 norm16.nordprim.local akonadi_contacts_resource[4687]: QSocketNotifier: Invalid socket 9 and type 'Read', disabling...
sie 27 07:41:41 norm16.nordprim.local akonadi_ical_resource[4689]: QSocketNotifier: Invalid socket 7 and type 'Read', disabling...
sie 27 07:41:41 norm16.nordprim.local akonadi_ical_resource[4689]: QSocketNotifier: Invalid socket 9 and type 'Read', disabling...
sie 27 07:41:41 norm16.nordprim.local akonadiserver[4580]: org.kde.pim.akonadiserver: Control process died, committing suicide!
sie 27 07:41:41 norm16.nordprim.local akonadiserver[4580]: org.kde.pim.akonadiserver: Subscriber "ETMCalendarMonitor - 94359498397104" disconnected
sie 27 07:41:41 norm16.nordprim.local akonadi_ical_resource[4689]: QSocketNotifier: Invalid socket 10 and type 'Read', disabling...
sie 27 07:41:41 norm16.nordprim.local akonadi_ical_resource[4689]: QSocketNotifier: Invalid socket 11 and type 'Read', disabling...
sie 27 07:41:41 norm16.nordprim.local akonadi_followupreminder_agent[4688]: QSocketNotifier: Invalid socket 10 and type 'Read', disabling...
sie 27 07:41:41 norm16.nordprim.local akonadi_followupreminder_agent[4688]: QSocketNotifier: Invalid socket 11 and type 'Read', disabling...
sie 27 07:41:41 norm16.nordprim.local akonadiserver[4580]: org.kde.pim.akonadiserver: Subscriber "" disconnected
sie 27 07:41:41 norm16.nordprim.local akonadiserver[4580]: org.kde.pim.akonadiserver: Subscriber "" disconnected
sie 27 07:41:41 norm16.nordprim.local akonadi_akonotes_resource[4684]: QSocketNotifier: Invalid socket 10 and type 'Read', disabling...
sie 27 07:41:41 norm16.nordprim.local akonadi_akonotes_resource[4684]: QSocketNotifier: Invalid socket 11 and type 'Read', disabling...
sie 27 07:41:41 norm16.nordprim.local akonadi_maildir_resource[4691]: QSocketNotifier: Invalid socket 10 and type 'Read', disabling...
sie 27 07:41:41 norm16.nordprim.local akonadi_maildir_resource[4691]: QSocketNotifier: Invalid socket 11 and type 'Read', disabling...
sie 27 07:41:41 norm16.nordprim.local kdeinit5[4364]: kdeinit5: Fatal IO error: client killed
sie 27 07:41:41 norm16.nordprim.local kdeinit5[4364]: kdeinit5: sending SIGHUP to children.
sie 27 07:41:41 norm16.nordprim.local kdeinit5[4364]: kdeinit5: sending SIGTERM to children.
sie 27 07:41:41 norm16.nordprim.local kdeinit5[4364]: kdeinit5: Exit.

I got a pretty obvious workaround for my problem:

Instead of just adding kadu and MEGAsync to autostart I created scripts for both of those apps that first tries to kill any existing process of those apps and then just starts it. It looks like this:

#!/bin/bash
pkill -fx kadu -9
kadu

That solves my problem but of course it would be better to fix the issue between DisplayLink and kscreen.
I may start a new thread for that issue.