Server fails to start after update script

Hello,

I run a V-Server with Debian Buster just for teamspeak. It updates itself so I don’t have to do anything.
For the Teamspeak server I wrote a small script which downloads the current version once a week and restarts the server. It runs in the root crontab.

#!/bin/bash
systemctl stop teamspeak
Teamspeak=$(curl -s "https://www.teamspeak.com/versions/server.json" | jq 
'."linux"."x86_64"."mirrors"."teamspeak.com"')
tsdownload=tsdownload.tar.bz2
su - ts3 -c "wget $Teamspeak -O /home/ts3/$tsdownload"
su - ts3 -c "tar -xjf /home/ts3/$tsdownload"
su - ts3 -c "rm /home/ts3/$tsdownload"
rm /dev/shm/7gbhujb54g8z9hu43jre8
sleep 5
systemctl start teamspeak

Unfortunately the server does not start properly. The following error message appears:

2020-05-25 03:00:09.963103|INFO    |ServerLibPriv |   |TeamSpeak 3 Server 3.12.1 (2020-03-27 10:38:47)
2020-05-25 03:00:09.963260|INFO    |ServerLibPriv |   |SystemInformation: Linux 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2 (2020-04-29) x86_64 Binary: 64bit
2020-05-25 03:00:09.963279|WARNING |ServerLibPriv |   |The system locale is set to "C" this can cause unexpected behavior. We advice you to repair your locale!
2020-05-25 03:00:09.963294|INFO    |ServerLibPriv |   |Using hardware aes
2020-05-25 03:00:09.964044|INFO    |DatabaseQuery |   |dbPlugin name:    SQLite3 plugin, Version 3, (c)TeamSpeak Systems GmbH
2020-05-25 03:00:09.964078|INFO    |DatabaseQuery |   |dbPlugin version: 3.11.1
2020-05-25 03:00:09.964315|INFO    |DatabaseQuery |   |checking database integrity (may take a while)
2020-05-25 03:00:09.976676|WARNING |Accounting    |   |Unable to open licensekey.dat, falling back to limited functionality
2020-05-25 03:00:09.976938|INFO    |Accounting    |   |Licensing Information
2020-05-25 03:00:09.976960|INFO    |Accounting    |   |licensed to       : Anonymous
2020-05-25 03:00:09.976971|INFO    |Accounting    |   |type              : No License
2020-05-25 03:00:09.976984|INFO    |Accounting    |   |starting date     : Sat Feb  1 00:00:00 2020
2020-05-25 03:00:09.976994|INFO    |Accounting    |   |ending date       : Mon Feb  1 00:00:00 2021
2020-05-25 03:00:09.977002|INFO    |Accounting    |   |max virtualservers: 1
2020-05-25 03:00:09.977010|INFO    |Accounting    |   |max slots         : 32
2020-05-25 03:00:11.376789|INFO    |              |   |Puzzle precompute time: 1381
2020-05-25 03:00:11.377394|INFO    |FileManager   |   |listening on 0.0.0.0:30033, [::]:30033
2020-05-25 03:00:11.391186|INFO    |CIDRManager   |   |updated query_ip_whitelist ips: 127.0.0.1/32, ::1/128,
2020-05-25 03:00:11.436849|INFO    |              |   |myTeamSpeak identifier revocation list was downloaded successfully - all related features are activated
2020-05-25 03:00:15.082232|ERROR   |Accounting    |   |failed to register local accounting service: No such file or directory

My systemd teamspeak.service file:

[Unit]
Description=Teamspeak 3 Server
After=network.service

[Service]
User=ts3
Group=ts3
Type=forking
WorkingDirectory=/home/ts3/teamspeak3-server_linux_amd64/
ExecStart=/home/ts3/teamspeak3-server_linux_amd64/ts3server_startscript.sh start query_protocols=""
ExecStop=/home/ts3/teamspeak3-server_linux_amd64/ts3server_startscript.sh stop
PIDFile=/home/ts3/teamspeak3-server_linux_amd64/ts3server.pid
RestartSec=3
Restart=on-failure

[Install]
WantedBy=multi-user.target

If I start the server manually it works fine.

I had a different problem last week. Instead of “No such file or directory” the error was “File already exists”.
But I don’t think this is the problem, because the file should be created after the Server starts which it does after the removal.

What does grep shm /proc/mounts give?

tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0