Files
jsonnutserver/jsonnutserver.service
2026-09-24 13:16:47 +05:00

24 lines
531 B
Desktop File

[Unit]
Description=JSON HTTP API for NUT upsc
After=network-online.target nut-server.service
Wants=network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/python3 /opt/jsonnutserver/server.py
Environment=LISTEN_HOST=0.0.0.0
Environment=LISTEN_PORT=8000
Environment=PYTHONUNBUFFERED=1
Restart=on-failure
RestartSec=5
# runs as a throwaway unprivileged user; upsc only needs network access to upsd
DynamicUser=yes
NoNewPrivileges=yes
ProtectSystem=strict
ProtectHome=yes
PrivateTmp=yes
[Install]
WantedBy=multi-user.target