57 lines
1.5 KiB
SYSTEMD
57 lines
1.5 KiB
SYSTEMD
[Unit]
|
|
Description=Movie Scheduler - Automated video processing and streaming
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=scheduler
|
|
Group=scheduler
|
|
WorkingDirectory=/opt/scheduler
|
|
|
|
# Environment variables (or use EnvironmentFile)
|
|
Environment="NOCODB_URL=https://your-nocodb.com/api/v2/tables/YOUR_TABLE_ID/records"
|
|
Environment="NOCODB_TOKEN=YOUR_TOKEN_HERE"
|
|
Environment="RTMP_SERVER=rtmp://your-rtmp-server.com/live/stream"
|
|
Environment="RAW_DIR=/mnt/storage/raw_movies"
|
|
Environment="FINAL_DIR=/mnt/storage/final_movies"
|
|
Environment="WHISPER_MODEL=/opt/models/ggml-base.bin"
|
|
Environment="VAAPI_DEVICE=/dev/dri/renderD128"
|
|
Environment="STREAM_GRACE_PERIOD_MINUTES=15"
|
|
Environment="NOCODB_SYNC_INTERVAL_SECONDS=60"
|
|
Environment="WATCHDOG_CHECK_INTERVAL_SECONDS=10"
|
|
|
|
# Or use external environment file (recommended for secrets)
|
|
# EnvironmentFile=/etc/scheduler/scheduler.env
|
|
|
|
# Python virtual environment
|
|
ExecStart=/opt/scheduler/venv/bin/python /opt/scheduler/agent.py
|
|
|
|
# Restart policy
|
|
Restart=always
|
|
RestartSec=10
|
|
|
|
# Security hardening
|
|
NoNewPrivileges=true
|
|
PrivateTmp=true
|
|
ProtectSystem=strict
|
|
ProtectHome=true
|
|
ReadWritePaths=/mnt/storage /opt/scheduler
|
|
|
|
# Allow access to GPU for VAAPI
|
|
DeviceAllow=/dev/dri/renderD128 rw
|
|
SupplementaryGroups=video render
|
|
|
|
# Logging
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
SyslogIdentifier=scheduler
|
|
|
|
# Resource limits (adjust based on your needs)
|
|
LimitNOFILE=65536
|
|
MemoryMax=4G
|
|
CPUQuota=200%
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|