1 parent
ef3139ca64
commit
818d391022
59 files changed
+2336
-8080
No files matched your search
+23
-407
@@ -1,427 +1,43 @@
|
||||
# Echoion Standalone - Systemd Service
|
||||
# Echoion Standalone systemd service
|
||||
|
||||
The supported service is `echoion-standalone.service`. It runs `echoiond`
|
||||
directly; no graphical TeamSpeak client, Weston session, or plugin directory is
|
||||
required.
|
||||
Echoion is deployed as the `echoiond` standalone daemon. The legacy TeamSpeak
|
||||
client plugin and its graphical/headless TeamSpeak client services are no
|
||||
longer supported.
|
||||
|
||||
## Supported service
|
||||
## Install
|
||||
|
||||
- `echoion-standalone.service` - User service for the standalone daemon.
|
||||
Build and install Echoion, then copy the user service:
|
||||
|
||||
The `teamspeak-echoion*.service` files and GUI/headless helper scripts remain
|
||||
only as archived compatibility material for `BUILD_PLUGIN=ON` deployments.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. **Weston** - Wayland compositor
|
||||
```bash
|
||||
sudo pacman -S weston
|
||||
```
|
||||
|
||||
2. **DBus** - For session management
|
||||
```bash
|
||||
sudo pacman -S dbus
|
||||
```
|
||||
|
||||
3. **TeamSpeak 3 Client** - Installed in `/home/bot/TeamSpeak3-Client-linux_amd64`
|
||||
|
||||
4. **TLS Certificates** - For RDP connections
|
||||
```bash
|
||||
# Generate self-signed certificates
|
||||
openssl req -x509 -newkey rsa:4096 \
|
||||
-keyout ~/.config/EchoionTsBot.key \
|
||||
-out ~/.config/EchoionTsBot.crt \
|
||||
-days 365 -nodes
|
||||
```
|
||||
|
||||
## Quick Install
|
||||
|
||||
### Option 1: User Service (Recommended)
|
||||
|
||||
Run as your bot user:
|
||||
```bash
|
||||
cd ~/echoion/scripts
|
||||
./install-service.sh user
|
||||
```
|
||||
|
||||
This creates a user service that runs as the bot user.
|
||||
|
||||
**⚠️ Important: DBus Session Error**
|
||||
|
||||
If you get an error like:
|
||||
```
|
||||
Failed to connect to user scope bus via local transport: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined
|
||||
```
|
||||
|
||||
This happens when running from a minimal shell without a full user session. This is **normal** and the service files are still installed correctly. See the [DBus Session section](#dbus-session-setup) below for solutions.
|
||||
|
||||
### Option 2: System Service
|
||||
|
||||
Run as root:
|
||||
```bash
|
||||
cd /path/to/echoion/scripts
|
||||
sudo ./install-service.sh system
|
||||
```
|
||||
|
||||
## Manual Installation
|
||||
|
||||
### User Service
|
||||
|
||||
1. Copy service file:
|
||||
```bash
|
||||
mkdir -p ~/.config/systemd/user
|
||||
cp teamspeak-echoion-user.service ~/.config/systemd/user/teamspeak-echoion.service
|
||||
```
|
||||
|
||||
2. Copy wrapper script:
|
||||
```bash
|
||||
mkdir -p ~/echoion/scripts
|
||||
cp run-teamspeak-headless.sh ~/echoion/scripts/
|
||||
chmod +x ~/echoion/scripts/run-teamspeak-headless.sh
|
||||
```
|
||||
|
||||
3. Reload systemd:
|
||||
```bash
|
||||
systemctl --user daemon-reload
|
||||
```
|
||||
|
||||
4. Start service:
|
||||
```bash
|
||||
systemctl --user start teamspeak-echoion
|
||||
```
|
||||
|
||||
5. Enable on login:
|
||||
```bash
|
||||
systemctl --user enable teamspeak-echoion
|
||||
```
|
||||
|
||||
6. Enable on boot (without login):
|
||||
```bash
|
||||
sudo loginctl enable-linger $(whoami)
|
||||
```
|
||||
|
||||
### System Service
|
||||
|
||||
1. Copy service file:
|
||||
```bash
|
||||
sudo cp teamspeak-echoion.service /etc/systemd/system/
|
||||
```
|
||||
|
||||
2. Edit service file to match your user:
|
||||
```bash
|
||||
sudo systemctl edit --full teamspeak-echoion
|
||||
```
|
||||
|
||||
3. Reload systemd:
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
```
|
||||
|
||||
4. Start service:
|
||||
```bash
|
||||
sudo systemctl start teamspeak-echoion
|
||||
```
|
||||
|
||||
5. Enable on boot:
|
||||
```bash
|
||||
sudo systemctl enable teamspeak-echoion
|
||||
```
|
||||
|
||||
## DBus Session Setup
|
||||
|
||||
When running the install script or systemd commands via SSH or a minimal shell, you may encounter:
|
||||
```
|
||||
Failed to connect to user scope bus via local transport: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined
|
||||
```
|
||||
|
||||
This is normal and the service files are still installed correctly. Here are the solutions:
|
||||
|
||||
### Solution 1: Use SSH with PTY (Easiest)
|
||||
|
||||
Connect with a pseudo-terminal allocation:
|
||||
```bash
|
||||
ssh -t bot@your-server bash
|
||||
```
|
||||
|
||||
Then run systemd commands normally:
|
||||
```bash
|
||||
mkdir -p ~/.config/systemd/user
|
||||
cp systemd/echoion-standalone.service ~/.config/systemd/user/
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user start teamspeak-echoion
|
||||
systemctl --user enable --now echoion-standalone.service
|
||||
```
|
||||
|
||||
### Solution 2: Enable Lingering and Reboot
|
||||
|
||||
Enable lingering so the user services start on boot without needing a login session:
|
||||
```bash
|
||||
sudo loginctl enable-linger bot
|
||||
```
|
||||
|
||||
Then reboot the server. After reboot, the service will start automatically.
|
||||
|
||||
### Solution 3: Manual Start (No systemd)
|
||||
|
||||
If you just want to test or can't get systemd working:
|
||||
```bash
|
||||
~/echoion/scripts/run-teamspeak-headless.sh
|
||||
```
|
||||
|
||||
Or use the helper script:
|
||||
```bash
|
||||
~/echoion/scripts/start-echoion.sh
|
||||
```
|
||||
|
||||
### Solution 4: Use tmux/screen
|
||||
|
||||
Run in a persistent terminal session:
|
||||
```bash
|
||||
tmux new-session -d -s teamspeak '~/echoion/scripts/run-teamspeak-headless.sh'
|
||||
```
|
||||
|
||||
To view: `tmux attach -t teamspeak`
|
||||
To detach: Press `Ctrl+B` then `D`
|
||||
|
||||
### Solution 5: System Service (No DBus needed)
|
||||
|
||||
Install as a system service instead (requires root):
|
||||
```bash
|
||||
sudo ~/echoion/scripts/install-service.sh system
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Check Service Status
|
||||
|
||||
**User service:**
|
||||
```bash
|
||||
systemctl --user status teamspeak-echoion
|
||||
```
|
||||
|
||||
**System service:**
|
||||
```bash
|
||||
sudo systemctl status teamspeak-echoion
|
||||
```
|
||||
|
||||
### View Logs
|
||||
|
||||
**User service:**
|
||||
```bash
|
||||
journalctl --user -u teamspeak-echoion -f
|
||||
```
|
||||
|
||||
**System service:**
|
||||
```bash
|
||||
sudo journalctl -u teamspeak-echoion -f
|
||||
```
|
||||
|
||||
### Stop Service
|
||||
|
||||
**User service:**
|
||||
```bash
|
||||
systemctl --user stop teamspeak-echoion
|
||||
```
|
||||
|
||||
**System service:**
|
||||
```bash
|
||||
sudo systemctl stop teamspeak-echoion
|
||||
```
|
||||
|
||||
### Restart Service
|
||||
|
||||
**User service:**
|
||||
```bash
|
||||
systemctl --user restart teamspeak-echoion
|
||||
```
|
||||
|
||||
**System service:**
|
||||
```bash
|
||||
sudo systemctl restart teamspeak-echoion
|
||||
```
|
||||
|
||||
## RDP Connection
|
||||
|
||||
Once the service is running, you can connect via RDP to manage TeamSpeak:
|
||||
|
||||
**Default port is now 3390** (changed from 3389 to avoid conflicts):
|
||||
For a service that starts before interactive login, enable lingering for the
|
||||
service account:
|
||||
|
||||
```bash
|
||||
xfreerdp3 /v:localhost:3390 /u:bot /p: /cert:ignore
|
||||
sudo loginctl enable-linger "$USER"
|
||||
```
|
||||
|
||||
Or use any RDP client with:
|
||||
- **Host**: Your server IP or localhost
|
||||
- **Port**: 3390 (default, or change in service file)
|
||||
- **Username**: bot (or your configured user)
|
||||
- **TLS**: Enabled (uses the certificates you provided)
|
||||
The service expects the installed `echoiond` executable, configuration, and
|
||||
release manifest paths documented in `echoion-standalone.service`. Override
|
||||
them without editing the tracked unit:
|
||||
|
||||
**To use a different port**, edit the service:
|
||||
```bash
|
||||
systemctl --user edit --full teamspeak-echoion
|
||||
systemctl --user edit echoion-standalone.service
|
||||
```
|
||||
|
||||
Change `RDP_PORT=3390` to your preferred port.
|
||||
## Operations
|
||||
|
||||
## Configuration
|
||||
|
||||
Edit the service file to customize:
|
||||
|
||||
- **User/Group**: Change `bot` to your bot user
|
||||
- **Paths**: Update paths to TeamSpeak, certificates, and scripts
|
||||
- **Environment**: Add or modify environment variables
|
||||
- **Resources**: Adjust `LimitNOFILE` and `LimitNPROC`
|
||||
- **Restart policy**: Change `Restart` and `RestartSec` values
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Service fails to start
|
||||
|
||||
1. Check logs:
|
||||
```bash
|
||||
journalctl -u teamspeak-echoion --no-pager -n 50
|
||||
```
|
||||
|
||||
2. Verify certificates exist:
|
||||
```bash
|
||||
ls -la ~/.config/EchoionTsBot.*
|
||||
```
|
||||
|
||||
3. Test wrapper script manually:
|
||||
```bash
|
||||
~/echoion/scripts/run-teamspeak-headless.sh
|
||||
```
|
||||
|
||||
### Weston/RDP issues
|
||||
|
||||
#### Error: "RDP unable to bind socket"
|
||||
|
||||
This is the most common error. Several things can cause this:
|
||||
|
||||
**1. Port already in use or permission denied**
|
||||
```bash
|
||||
# Check if port is in use
|
||||
sudo ss -tlnp | grep 3389
|
||||
|
||||
# Try a different port (edit service file to use port 3390 or higher)
|
||||
export RDP_PORT=3390
|
||||
~/echoion/scripts/run-teamspeak-headless.sh
|
||||
systemctl --user status echoion-standalone.service
|
||||
journalctl --user -u echoion-standalone.service -f
|
||||
systemctl --user restart echoion-standalone.service
|
||||
```
|
||||
|
||||
**2. Certificate issues**
|
||||
```bash
|
||||
# Check certificates exist and are readable
|
||||
ls -la ~/.config/EchoionTsBot.*
|
||||
|
||||
# Generate new certificates if needed
|
||||
openssl req -x509 -newkey rsa:4096 \
|
||||
-keyout ~/.config/EchoionTsBot.key \
|
||||
-out ~/.config/EchoionTsBot.crt \
|
||||
-days 365 -nodes
|
||||
|
||||
# Fix permissions
|
||||
chmod 600 ~/.config/EchoionTsBot.key
|
||||
chmod 644 ~/.config/EchoionTsBot.crt
|
||||
```
|
||||
|
||||
**3. Missing weston RDP backend**
|
||||
```bash
|
||||
# Check if RDP backend is installed
|
||||
ls -la /usr/lib/libweston-*/rdp-backend.so
|
||||
|
||||
# If missing, install weston properly
|
||||
sudo pacman -S weston
|
||||
```
|
||||
|
||||
**4. Test weston without TeamSpeak**
|
||||
```bash
|
||||
# Create test directory
|
||||
mkdir -p /tmp/test-weston
|
||||
export XDG_RUNTIME_DIR=/tmp/test-weston
|
||||
|
||||
# Test weston only
|
||||
dbus-run-session -- weston --backend=rdp --rdp-port=3390
|
||||
|
||||
# If this works, the issue is with the full setup
|
||||
```
|
||||
|
||||
**5. Use alternative port (3390 instead of 3389)**
|
||||
The service now defaults to port 3390 to avoid conflicts. To change the port:
|
||||
|
||||
Edit the service file:
|
||||
```bash
|
||||
systemctl --user edit --full teamspeak-echoion
|
||||
```
|
||||
|
||||
Change:
|
||||
```ini
|
||||
Environment="RDP_PORT=3390"
|
||||
```
|
||||
|
||||
To your preferred port (e.g., 3391, 3392, etc.)
|
||||
|
||||
#### Other RDP issues
|
||||
|
||||
1. Check weston configuration:
|
||||
```bash
|
||||
cat ~/.config/weston.ini
|
||||
```
|
||||
|
||||
2. Run diagnostic script:
|
||||
```bash
|
||||
~/echoion/scripts/diagnose-echoion.sh
|
||||
```
|
||||
|
||||
3. Check weston logs:
|
||||
```bash
|
||||
journalctl --user -u teamspeak-echoion --no-pager -n 100
|
||||
```
|
||||
|
||||
### Permission issues
|
||||
|
||||
1. Check file ownership:
|
||||
```bash
|
||||
ls -la ~/TeamSpeak3-Client-linux_amd64/
|
||||
ls -la ~/.config/EchoionTsBot.*
|
||||
```
|
||||
|
||||
2. Fix permissions:
|
||||
```bash
|
||||
sudo chown -R bot:bot ~/TeamSpeak3-Client-linux_amd64/
|
||||
sudo chown bot:bot ~/.config/EchoionTsBot.*
|
||||
```
|
||||
|
||||
## Security Notes
|
||||
|
||||
1. **Firewall**: Restrict RDP port (3389) access to trusted IPs only
|
||||
```bash
|
||||
sudo ufw allow from 192.168.1.0/24 to any port 3389
|
||||
```
|
||||
|
||||
2. **Certificates**: Use proper TLS certificates in production, not self-signed
|
||||
|
||||
3. **User permissions**: Run as non-root user with minimal privileges
|
||||
|
||||
4. **Network isolation**: Consider running in a container or VM for isolation
|
||||
|
||||
## Uninstallation
|
||||
|
||||
### User Service
|
||||
```bash
|
||||
systemctl --user stop teamspeak-echoion
|
||||
systemctl --user disable teamspeak-echoion
|
||||
rm ~/.config/systemd/user/teamspeak-echoion.service
|
||||
systemctl --user daemon-reload
|
||||
```
|
||||
|
||||
### System Service
|
||||
```bash
|
||||
sudo systemctl stop teamspeak-echoion
|
||||
sudo systemctl disable teamspeak-echoion
|
||||
sudo rm /etc/systemd/system/teamspeak-echoion.service
|
||||
sudo systemctl daemon-reload
|
||||
```
|
||||
|
||||
## See Also
|
||||
|
||||
- [Weston Documentation](https://wayland.freedesktop.org/weston.html)
|
||||
- [systemd Documentation](https://www.freedesktop.org/software/systemd/man/)
|
||||
- [TeamSpeak 3 Client](https://www.teamspeak.com/)
|
||||
- [Echoion Bot Documentation](../README.md)
|
||||
TeamSpeak protocol, query transport, identity, and typed administration are
|
||||
provided by VoidTeamspeak. EchoionStandalone only adapts those APIs to the
|
||||
Echoion core contracts.
|
||||
@@ -1,7 +1,5 @@
|
||||
# Echoion standalone daemon — connects to a TeamSpeak 3/6 server as its own
|
||||
# client over the native UDP protocol. Replaces the old
|
||||
# teamspeak-echoion.service, which had to run a full GUI TeamSpeak client under
|
||||
# Weston + RDP just to host the plugin. None of that is needed anymore.
|
||||
# Echoion standalone daemon. TeamSpeak transport and protocol behavior are
|
||||
# provided by VoidTeamspeak; this process hosts the Echoion adapter and core.
|
||||
#
|
||||
# Install: copy `echoiond` and `Echoion.ts` (the Core library) somewhere on
|
||||
# disk, put config.json in ~/.config/echoion/ (or pass --config), then:
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
[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
|
||||
@@ -1,55 +0,0 @@
|
||||
[Unit]
|
||||
Description=TeamSpeak 3 Client with Echoion Music Bot
|
||||
After=network.target sound.target
|
||||
Wants=network.target sound.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=bot
|
||||
Group=bot
|
||||
|
||||
# Working directory where TeamSpeak client is installed
|
||||
WorkingDirectory=/home/bot/TeamSpeak3-Client-linux_amd64
|
||||
|
||||
# Environment setup
|
||||
Environment="XDG_RUNTIME_DIR=/tmp/.ts3bot-display"
|
||||
Environment="HOME=/home/bot"
|
||||
Environment="USER=bot"
|
||||
Environment="DISPLAY=:1"
|
||||
|
||||
# Create runtime directory and start the service
|
||||
ExecStartPre=/bin/mkdir -p /tmp/.ts3bot-display
|
||||
ExecStartPre=/bin/chmod 700 /tmp/.ts3bot-display
|
||||
|
||||
# Main command - runs dbus, weston with RDP backend, and TeamSpeak
|
||||
ExecStart=/bin/bash -c 'cd /home/bot/TeamSpeak3-Client-linux_amd64 && \
|
||||
dbus-run-session -- \
|
||||
weston \
|
||||
--backend=rdp \
|
||||
--xwayland \
|
||||
--rdp-tls-cert=/home/bot/.config/EchoionTsBot.crt \
|
||||
--rdp-tls-key=/home/bot/.config/EchoionTsBot.key \
|
||||
-- ./ts3client_runscript.sh'
|
||||
|
||||
# Restart policy
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StartLimitInterval=60
|
||||
StartLimitBurst=3
|
||||
|
||||
# Resource limits
|
||||
LimitNOFILE=65536
|
||||
LimitNPROC=4096
|
||||
|
||||
# Security settings
|
||||
NoNewPrivileges=false
|
||||
ProtectSystem=no
|
||||
ProtectHome=no
|
||||
|
||||
# Logging
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=teamspeak-echoion
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in new issue
Block a user