This commit is contained in:
2026-09-24 13:16:47 +05:00
commit 538b71596c
3 changed files with 202 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
[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