I have an update:
I deleted the /etc/ld.so.preload-file and added a file override.conf to /etc/systemd/system/vdr.service.d/ and /etc/systemd/system/sundtek.service.d
The override.conf file contains these two lines:
[Service]
Environment=LD_PRELOAD=/opt/lib/libmediaclient.so
I removed all VDR plugings and other packages related to VDR, except vdr and vdr-plugin-vnsiserver.
With this configuration, the server runs stable and VDR works; i can connect with KODI from a remote PC.
It was running for more than 36 hours without any problem.
Then i restored the file /etc/ld.so.preload which contains only one line "/opt/lib/libmediaclient.so" and executed "systemctl daemon-reload" (no reboot); after a few hours, the same problem happened again.
For debugging, i logged into all 6 local tty-consoles with user "root" on the server directly after booting.
In one console, i ran "htop", in another console i ran "dmesg -w" and some other logs in other consoles.
After a few hours, i noticed the server had the problem. During this time, VDR was in idle mode, no KODI was runnig.
On the local console, the htop output was freezed, but it showed no high cpu or memory usage. In the dmesg output, i had a lot of apparmor warnings with name="/opt/lib/libmediaclient.so", similar like in my first post.
I can switch between these consoles with <Alt>-F1/2/3...
When i enter a command in a console, e.g., "ls", it doesn't respond. But then, after pressing <CTRL>-C, i get the output of the ls command.
Then i deleted the file /etc/ld.so.preload and executed "systemctl daemon-reload", always with <CTRL>-C afterwards. After doing this, the server seemed to operate normal.
I tried to restart VDR with "systemctl restart vdr", but this command did not finish, i had to press <CTRL>-C.
I tried it multiple times and also with stop and start separately.
Then i did a reboot, it took a long time to shut down (several minutes).
After rebooting, i checked the VDR log (journalctl -u vdr).
There you can see some error messages from the failed vdr start before reboot:
Jan 30 13:26:00 srv1 systemd[1]: Starting vdr.service - Video Disk Recorder...
Jan 30 13:26:00 srv1 vdr[35811]: [35811] VDR version 2.6.9 started
Jan 30 13:26:00 srv1 vdr[35811]: [35811] switched to user 'vdr'
Jan 30 13:26:00 srv1 vdr[35811]: [35811] codeset is 'UTF-8' - known
Jan 30 13:26:00 srv1 vdr[35811]: [35811] found 28 locales in /usr/share/locale
Jan 30 13:26:00 srv1 vdr[35811]: [35811] no locale for language code 'alb,sqi'
Jan 30 13:26:00 srv1 vdr[35811]: [35811] no locale for language code 'bos'
Jan 30 13:26:00 srv1 vdr[35811]: [35811] no locale for language code 'bul'
Jan 30 13:26:00 srv1 vdr[35811]: [35811] no locale for language code 'chi,zho'
Jan 30 13:26:00 srv1 vdr[35811]: [35811] no locale for language code 'eus,baq'
Jan 30 13:26:00 srv1 vdr[35811]: [35811] no locale for language code 'iri,gle'
Jan 30 13:26:00 srv1 vdr[35811]: [35811] no locale for language code 'jpn'
Jan 30 13:26:00 srv1 vdr[35811]: [35811] no locale for language code 'lav'
Jan 30 13:26:00 srv1 vdr[35811]: [35811] no locale for language code 'ltz'
Jan 30 13:26:00 srv1 vdr[35811]: [35811] no locale for language code 'mlt'
Jan 30 13:26:00 srv1 vdr[35811]: [35811] no locale for language code 'por'
Jan 30 13:26:00 srv1 vdr[35811]: [35811] no locale for language code 'smi'
Jan 30 13:26:00 srv1 vdr[35811]: [35811] loading plugin: /usr/lib/vdr/plugins/libvdr-vnsiserver.so.2.6.9
Jan 30 13:26:00 srv1 vdr[35811]: [35811] loading /var/lib/vdr/setup.conf
Jan 30 13:26:00 srv1 vdr[35811]: [35811] loading /var/lib/vdr/sources.conf
Jan 30 13:26:00 srv1 vdr[35811]: [35811] loading /var/lib/vdr/diseqc.conf
Jan 30 13:26:00 srv1 vdr[35811]: [35811] loading /var/lib/vdr/scr.conf
Jan 30 13:26:00 srv1 vdr[35811]: [35811] loading /var/lib/vdr/channels.conf
Jan 30 13:26:00 srv1 vdr[35811]: [35811] loading /var/lib/vdr/timers.conf
Jan 30 13:26:00 srv1 vdr[35811]: [35811] loading /var/lib/vdr/commands.conf
Jan 30 13:26:00 srv1 vdr[35811]: [35811] loading /var/lib/vdr/reccmds.conf
Jan 30 13:26:00 srv1 vdr[35811]: [35811] loading /var/lib/vdr/svdrphosts.conf
Jan 30 13:26:00 srv1 vdr[35811]: [35811] loading /var/lib/vdr/keymacros.conf
Jan 30 13:26:00 srv1 vdr[35811]: [35813] video directory scanner thread started (pid=35811, tid=35813, prio=low)
Jan 30 13:26:00 srv1 vdr[35811]: [35814] epg data reader thread started (pid=35811, tid=35814, prio=high)
Jan 30 13:26:00 srv1 vdr[35811]: [35811] registered source parameters for 'A - ATSC'
Jan 30 13:26:00 srv1 vdr[35811]: [35811] registered source parameters for 'C - DVB-C'
Jan 30 13:26:00 srv1 vdr[35811]: [35811] registered source parameters for 'S - DVB-S'
Jan 30 13:26:00 srv1 vdr[35811]: [35811] registered source parameters for 'T - DVB-T'
Jan 30 13:26:00 srv1 vdr[35811]: [35811] detected /dev/dvb/adapter1/frontend0
Jan 30 13:26:00 srv1 vdr[35811]: [35811] detected /dev/dvb/adapter0/frontend0
Jan 30 13:26:00 srv1 vdr[35811]: [35814] reading EPG data from /var/cache/vdr/epg.data
Jan 30 13:26:00 srv1 vdr[35811]: [35811] ERROR (dvbdevice.c,1945): /dev/dvb/adapter0/frontend0: Kein passendes Gerät bzw. keine passende Adresse gefunden
Jan 30 13:26:00 srv1 vdr[35811]: [35811] ERROR (dvbdevice.c,1945): /dev/dvb/adapter1/frontend0: Kein passendes Gerät bzw. keine passende Adresse gefunden
Jan 30 13:26:00 srv1 vdr[35811]: vdr: no primary device found - using first device!
Jan 30 13:26:00 srv1 vdr[35811]: [35811] no DVB device found
Jan 30 13:26:00 srv1 vdr[35811]: [35811] initializing plugin: vnsiserver (1.8.3): VDR-Network-Streaming-Interface (VNSI) Server
Jan 30 13:26:00 srv1 vdr[35811]: [35811] ERROR: invalid primary device number: 1
Jan 30 13:26:00 srv1 vdr[35811]: [35811] ERROR: no primary device found - using first device!
Jan 30 13:26:00 srv1 vdr[35811]: [35811] ERROR: invalid primary device number: 1
Jan 30 13:26:00 srv1 vdr[35811]: [35813] video directory scanner thread ended (pid=35811, tid=35813)
Jan 30 13:26:00 srv1 vdr[35811]: [35814] epg data reader thread ended (pid=35811, tid=35814)
Jan 30 13:26:01 srv1 vdr[35811]: [35811] deleting plugin: vnsiserver
Jan 30 13:26:01 srv1 vdr[35811]: [35811] max. latency time 0 seconds
Jan 30 13:26:01 srv1 vdr[35811]: [35811] exiting, exit code 2
Jan 30 13:26:01 srv1 systemd[1]: vdr.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jan 30 13:26:01 srv1 systemd[1]: vdr.service: Failed with result 'exit-code'.
Jan 30 13:26:01 srv1 systemd[1]: Failed to start vdr.service - Video Disk Recorder.
Jan 30 13:26:01 srv1 systemd[1]: vdr.service: Consumed 864ms CPU time, 121.7M memory peak.
So for me i have a solution, but maybe it would be interesting to find out why the servers hangs when the ld.so.preload file is installed.
Do you have any ideas, which logfiles i could check?