Phase 6 Complete: Systemd Service Creation

- Created systemd/sensorpajen.service user service unit
  - Uses %h for portability across systems
  - Loads environment from EnvironmentFile
  - Auto-restart with bluetooth capabilities
  - Comprehensive security settings

- Created systemd/README.md
  - Installation instructions
  - Service management commands
  - Troubleshooting guide
  - Log viewing examples

- Updated ROADMAP.md to mark Phase 6 complete
This commit is contained in:
2025-12-27 14:09:29 +01:00
parent b2f9bff765
commit d0ba2c5a52
3 changed files with 311 additions and 64 deletions

View File

@@ -0,0 +1,30 @@
[Unit]
Description=Sensorpajen - Bluetooth Temperature Sensor Monitor
Documentation=https://github.com/yourusername/sensorpajen
After=network.target bluetooth.target
Wants=bluetooth.target
[Service]
Type=simple
WorkingDirectory=%h/sensorpajen
EnvironmentFile=%h/sensorpajen/config/sensorpajen.env
ExecStart=%h/sensorpajen/.venv/bin/python -m sensorpajen.main
Restart=always
RestartSec=10
# Bluetooth capabilities (alternative to setcap)
# Note: This requires systemd to be run with proper permissions
# If this doesn't work, use setcap on the Python binary instead
#AmbientCapabilities=CAP_NET_RAW CAP_NET_ADMIN
# Logging
StandardOutput=journal
StandardError=journal
SyslogIdentifier=sensorpajen
# Security
NoNewPrivileges=true
PrivateTmp=true
[Install]
WantedBy=default.target