53 lines
1.2 KiB
Desktop File
53 lines
1.2 KiB
Desktop File
[Unit]
|
|
Description=TeamSpeak 3 Client with Echoion Music Bot
|
|
After=network.target sound.target
|
|
Wants=network.target sound.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
|
|
# Environment setup
|
|
Environment="XDG_RUNTIME_DIR=/tmp/.ts3bot-display-%u"
|
|
Environment="HOME=%h"
|
|
Environment="USER=%u"
|
|
Environment="RDP_PORT=3390"
|
|
Environment="WESTON_DEBUG=1"
|
|
|
|
# Working directory
|
|
WorkingDirectory=%h/TeamSpeak3-Client-linux_amd64
|
|
|
|
# Create runtime directory
|
|
ExecStartPre=/bin/mkdir -p /tmp/.ts3bot-display-%u
|
|
ExecStartPre=/bin/chmod 700 /tmp/.ts3bot-display-%u
|
|
|
|
# Check if port is available
|
|
ExecStartPre=-/bin/sh -c 'ss -tlnp | grep -q ":3390 " && echo "Port 3390 in use, trying alternative" && exit 1 || exit 0'
|
|
|
|
# Main command using the wrapper script
|
|
ExecStart=/home/bot/echoion/scripts/run-teamspeak-headless.sh
|
|
|
|
# Restart policy
|
|
Restart=always
|
|
RestartSec=10
|
|
StartLimitInterval=60
|
|
StartLimitBurst=3
|
|
|
|
# Resource limits
|
|
LimitNOFILE=65536
|
|
LimitNPROC=4096
|
|
|
|
# Security settings - allow binding to ports
|
|
PrivateNetwork=no
|
|
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
|
|
|
|
# Ensure we have proper socket permissions
|
|
UMask=0077
|
|
|
|
# Logging
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
SyslogIdentifier=teamspeak-echoion
|
|
|
|
[Install]
|
|
WantedBy=default.target
|