feat: Rename pockettts service to vox and improve numba caching
Renamed the systemd service from "pockettts" to "vox" for better branding and clarity. Updated the script to reflect the new service name. Addressed numba caching issues when running as a systemd service: - Created to explicitly set to a project-local directory (). - Modified to import early in the execution flow. - Updated the systemd service file to grant write permissions to the directory. - Added to to prevent caching files from being committed.
This commit is contained in:
32
setup_linux.sh
Normal file → Executable file
32
setup_linux.sh
Normal file → Executable file
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Pocket TTS Discord Bot - Linux Setup Script
|
||||
# Vox Discord Bot - Linux Setup Script
|
||||
# This script helps set up the bot and install it as a systemd service
|
||||
|
||||
set -e
|
||||
@@ -12,7 +12,7 @@ YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
echo -e "${GREEN}========================================${NC}"
|
||||
echo -e "${GREEN} Pocket TTS Discord Bot - Linux Setup${NC}"
|
||||
echo -e "${GREEN} Vox Discord Bot - Linux Setup${NC}"
|
||||
echo -e "${GREEN}========================================${NC}"
|
||||
echo
|
||||
|
||||
@@ -138,11 +138,11 @@ read -p "Do you want to install the bot as a systemd service? (y/n) " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
# Create the service file with correct paths
|
||||
SERVICE_FILE="/tmp/pockettts.service"
|
||||
SERVICE_FILE="/tmp/vox.service"
|
||||
|
||||
cat > "$SERVICE_FILE" << EOF
|
||||
[Unit]
|
||||
Description=Pocket TTS Discord Bot
|
||||
Description=Vox Discord Bot
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
@@ -156,7 +156,7 @@ RestartSec=10
|
||||
TimeoutStopSec=30
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=pockettts
|
||||
SyslogIdentifier=vox
|
||||
|
||||
# Security hardening
|
||||
NoNewPrivileges=true
|
||||
@@ -170,26 +170,26 @@ WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
echo " Installing systemd service (requires sudo)..."
|
||||
sudo cp "$SERVICE_FILE" /etc/systemd/system/pockettts.service
|
||||
sudo cp "$SERVICE_FILE" /etc/systemd/system/vox.service
|
||||
sudo systemctl daemon-reload
|
||||
echo -e " ${GREEN}✓${NC} Service installed"
|
||||
|
||||
read -p "Do you want to enable the service to start on boot? (y/n) " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
sudo systemctl enable pockettts
|
||||
sudo systemctl enable vox
|
||||
echo -e " ${GREEN}✓${NC} Service enabled for boot"
|
||||
fi
|
||||
|
||||
read -p "Do you want to start the service now? (y/n) " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
sudo systemctl start pockettts
|
||||
sudo systemctl start vox
|
||||
echo -e " ${GREEN}✓${NC} Service started"
|
||||
sleep 2
|
||||
echo
|
||||
echo " Service status:"
|
||||
sudo systemctl status pockettts --no-pager || true
|
||||
sudo systemctl status vox --no-pager || true
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -199,15 +199,15 @@ echo -e "${GREEN} Setup Complete!${NC}"
|
||||
echo -e "${GREEN}========================================${NC}"
|
||||
echo
|
||||
echo "Useful commands:"
|
||||
echo " Start bot: sudo systemctl start pockettts"
|
||||
echo " Stop bot: sudo systemctl stop pockettts"
|
||||
echo " Restart bot: sudo systemctl restart pockettts"
|
||||
echo " View status: sudo systemctl status pockettts"
|
||||
echo " View logs: journalctl -u pockettts -f"
|
||||
echo " Disable boot: sudo systemctl disable pockettts"
|
||||
echo " Start bot: sudo systemctl start vox"
|
||||
echo " Stop bot: sudo systemctl stop vox"
|
||||
echo " Restart bot: sudo systemctl restart vox"
|
||||
echo " View status: sudo systemctl status vox"
|
||||
echo " View logs: journalctl -u vox -f"
|
||||
echo " Disable boot: sudo systemctl disable vox"
|
||||
echo
|
||||
echo "To run the bot manually (without systemd):"
|
||||
echo " cd $SCRIPT_DIR"
|
||||
echo " source venv/bin/activate"
|
||||
echo " python bot.py"
|
||||
echo
|
||||
echo
|
||||
Reference in New Issue
Block a user