• Hey Guest, we're evolving the future of TeaSpeak.
    You're invited to join the discussion here!

[SOLVED] TeaSpeak Autostart Script Linux

rason

New member
So basically I've been messing around with some scripts, wrote a couple but none of them seems to work.
Any suggestions for an autostart script of TeaSpeak servers when I reboot my VPS? Because it doesn't have an autostart option by default,, but I need one.
Here is my latest one, but idk what's wrong it doesn't work.
"Bash: Error: teaspeakserver.service is not recognizeable"
Code:
[Unit]
Description=TeaSpeak Server

[Service]
ExecStart=/opt/teaspeak/teastart.sh start
ExecStop=/opt/teaspeak/teastart.sh stop
PIDFile=/opt/teaspeak/teapid.pid
Type=forking
User=root
Group=root

[Install]
WantedBy=multi-user.target
I'm grateful of all help!
 

DrN00bish

Well-known member
Mine is basically the same but working just fine. Your error though seems to be related to either the file not being called teaspeakserver.service or that you might have put it in the wrong folder. There are multiple places you can put the service script though and for some reason (I don't recall why I changed it lately) but on my debian 9 server I started to put it into /etc/systemd/system

Bash:
[Unit]
Description=TeaSpeak Server
Documentation=https://teaspeak.de/#about
After=network.target

[Service]
WorkingDirectory=/opt/TeaSpeak/
User=ts3
Group=ts3
Type=forking
ExecStart=/opt/TeaSpeak/teastart.sh start
ExecStop=/opt/TeaSpeak/teastart.sh stop
PIDFile=/opt/TeaSpeak/tpid.pid
RestartSec=10
Restart=always

[Install]
WantedBy=multi-user.target
 

rason

New member
Mine is basically the same but working just fine. Your error though seems to be related to either the file not being called teaspeakserver.service or that you might have put it in the wrong folder. There are multiple places you can put the service script though and for some reason (I don't recall why I changed it lately) but on my debian 9 server I started to put it into /etc/systemd/system

Bash:
[Unit]
Description=TeaSpeak Server
Documentation=https://teaspeak.de/#about
After=network.target

[Service]
WorkingDirectory=/opt/TeaSpeak/
User=ts3
Group=ts3
Type=forking
ExecStart=/opt/TeaSpeak/teastart.sh start
ExecStop=/opt/TeaSpeak/teastart.sh stop
PIDFile=/opt/TeaSpeak/tpid.pid
RestartSec=10
Restart=always

[Install]
WantedBy=multi-user.target

Basically I just got it working, it was in the right folder but my systemctl was wrong hehehe :D but thank you anyways :)