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:
30
systemd/sensorpajen.service
Normal file
30
systemd/sensorpajen.service
Normal 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
|
||||
Reference in New Issue
Block a user