Files
wedding-phone/wedding-phone.service
grabowski 13e1c6dd5c Fix systemd service to use uv with full path
Updated service to use uv run with absolute path to avoid
PATH issues in systemd environment.

Service file changes:
- ExecStart: Uses absolute path to uv (/home/berwn/.local/bin/uv)
- Runs: uv run --no-project python rotary_phone_web.py
- This ensures uv manages dependencies correctly

Install script improvements:
- Auto-detects uv location with 'which uv'
- Falls back to $HOME/.local/bin/uv if not in PATH
- Validates uv exists before proceeding
- Substitutes actual uv path into service file
- Shows detected uv path in output

This fixes:
  ModuleNotFoundError: No module named 'waitress'

Now uv properly manages the virtual environment and
dependencies are available to the service.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 16:16:08 +07:00

25 lines
555 B
Desktop File

[Unit]
Description=Wedding Phone - Vintage Rotary Phone Audio System
After=network.target sound.target
Wants=network.target sound.target
[Service]
Type=simple
User=berwn
Group=berwn
WorkingDirectory=/home/berwn/wedding-phone
Environment="PATH=/home/berwn/.local/bin:/usr/local/bin:/usr/bin:/bin"
ExecStart=/home/berwn/.local/bin/uv run --no-project python rotary_phone_web.py
Restart=always
RestartSec=10
# Security hardening
NoNewPrivileges=true
PrivateTmp=true
# Allow GPIO access
SupplementaryGroups=gpio audio
[Install]
WantedBy=multi-user.target