2026-10-05 10:45:24 +03:00
|
|
|
# managed by ovpmon deploy/native (install.sh / update.sh replace this file only while this marker line is present)
|
|
|
|
|
#
|
|
|
|
|
# OpenVPN Monitor gatherer (reads the OpenVPN status log into the monitoring database, APP_CORE).
|
|
|
|
|
# Install: see ovpmon-api.service. Settings come from /etc/ovpmon/env.
|
|
|
|
|
# The gatherer starts and keeps running while OpenVPN is down (it waits for the status log).
|
2026-01-28 22:37:47 +03:00
|
|
|
[Unit]
|
|
|
|
|
Description=OpenVPN Monitor Gatherer
|
|
|
|
|
After=network.target
|
2026-10-05 10:45:24 +03:00
|
|
|
Wants=network.target
|
2026-01-28 22:37:47 +03:00
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
|
Type=simple
|
2026-10-05 10:45:24 +03:00
|
|
|
User=ovpmon
|
|
|
|
|
Group=ovpmon
|
|
|
|
|
EnvironmentFile=/etc/ovpmon/env
|
|
|
|
|
WorkingDirectory=/opt/OpenVPN-Monitoring-Simple/APP_CORE
|
|
|
|
|
ExecStart=/opt/OpenVPN-Monitoring-Simple/APP_CORE/venv/bin/python openvpn_gatherer_v3.py
|
2026-01-28 22:37:47 +03:00
|
|
|
Restart=always
|
2026-10-05 10:45:24 +03:00
|
|
|
RestartSec=3
|
|
|
|
|
|
|
|
|
|
# Hardening: code and virtualenv are root-owned and read-only for the service
|
|
|
|
|
NoNewPrivileges=yes
|
|
|
|
|
PrivateTmp=yes
|
|
|
|
|
ProtectHome=yes
|
|
|
|
|
ProtectSystem=full
|
|
|
|
|
ProtectKernelTunables=yes
|
|
|
|
|
ProtectKernelModules=yes
|
|
|
|
|
ProtectControlGroups=yes
|
|
|
|
|
RestrictRealtime=yes
|
|
|
|
|
LockPersonality=yes
|
|
|
|
|
# Write access: monitoring database (and its migration backups) and logs
|
|
|
|
|
ReadWritePaths=/var/lib/ovpmon /var/log/ovpmon
|
2026-01-28 22:37:47 +03:00
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
|
WantedBy=multi-user.target
|