joni1802 / ts3-manager

A modern web interface for maintaining Teamspeak3 servers
https://www.ts3.app
MIT License
189 stars 23 forks source link

systemctl not starting service: 503 Service unavailable #79

Closed Badetuch closed 1 year ago

Badetuch commented 1 year ago

Hi,

ts3-manager starts when I manually start it with 'sudo ./ts3-manager-linux-x64-v2.2.0'. But when I try to start it with 'sudo systemctl start ts3-manager', I get an '503 Service unavailable' error:

Screenshot_46

This is the output of 'sudo systemctl start ts3-manager': Screenshot_45

This is my ts3-manager.service file:

[Unit]
Description=TeamSpeak 3 Server Manager
After=network.service

[Service]
User=ts3-manager
Group=ts3-manager
Type=simple
WorkingDirectory=/var/www/html/ts3-manager/
Environment=PORT=8080
ExecStart=/var/www/ts3-manager/html/ts3-manager-linux-x64-v2.2.0
RestartSec=15
Restart=always
StandardOutput=journal
StandardError=inherit

[Install]
WantedBy=multi-user.target

I also made sure to apply all the permissions listed in the guide and cleared all my windows- and browser-cache OS: Debian 11, PHP8.1, Apache2, reverse-proxy enabled

joni1802 commented 1 year ago

The WorkingDirectory in your service file does not match with the ExecStart path. Maybe there is a permission issue with that. Does the user or group have write permissions to /var/www/html/ts3-manager/?

Badetuch commented 1 year ago

Thanks for the reply, I changed my service file to this:

[Unit]
Description=TeamSpeak 3 Server Manager
After=network.service

[Service]
User=ts3-manager
Group=ts3-manager
Type=simple
WorkingDirectory=/var/www/html/ts3-manager/
Environment=PORT=8080
ExecStart=/var/www/html/ts3-manager/ts3-manager-linux-x64-v2.2.0
RestartSec=15
Restart=always
StandardOutput=journal
StandardError=inherit

[Install]
WantedBy=multi-user.target

But I still get the 503 error whilst systemctl status is telling me that its running.

Could it be that I need to start the service with the 'ts3-manager' user? right now i start the service with sudo and a sudo eligible user. When I try to su to ts3-manager I get the error 'This account is currently not available.'.

joni1802 commented 1 year ago

I cannot help you with that. Sounds like a permission problem on your machine. Make sure that the user and group have write permission on the folder /var/www/html/ts3-manager/.
Or go the easy way and just use the docker container.