Closed tomiie6 closed 4 years ago
First of all, you should install expect
for a more stable functionality of the script.
Do you have any script / service, which ensures, that your TS3 server is running all the time? A systemd script for example?
The TS3UpdateScript automatically creates the file .ts3updatescript.lock
in the root directory of your instance. This indicates, that the script is currently updating your instance. You can use this file for conditions to avoid autom. restarts of the instance.
Here is an example for a systemd script:
$ cat /etc/systemd/system/ts3server.service
[Unit]
Description=TeamSpeak 3 Server
After=network.target mysqld.service
ConditionPathExists=!/home/teamspeak/.ts3updatescript.lock
[Install]
WantedBy=multi-user.target
Alias=ts3server.service
[Service]
User=teamspeak
Group=teamspeak
WorkingDirectory=/home/teamspeak/
ExecStart=/home/teamspeak/ts3server_startscript.sh start
ExecStop=/home/teamspeak/ts3server_startscript.sh stop
ExecReload=/home/teamspeak/ts3server_startscript.sh restart
PIDFile=/home/teamspeak/ts3server.pid
Restart=always
Type=forking
Thank you @Sebi94nbg , adding the 'ConditionPathExists' property solved the issue.
cp: cannot create regular file ‘./ts3server’: Text file busy Could not start TeamSpeak 3 server instance. Did the script possibly fail to stop the service? I thought that first because it logged it couldn't restart it after the (errored) update process, but it was running actually. Then I retried the update and here's what happened: the server stopped as intended but came back online by the time the 'Backup created successful.' line appeared in the log, so no wonder the 'ts3server' file couldn't be overwritten during the update. What can be wrong? It worked fine before.