2.2 KiB
2.2 KiB
Service Setup Guide
This guide describes how to set up the OpenVPN Monitor components as system services.
Components
- ovpmon-api: The main Flask API (
APP/openvpn_api_v3.py). - ovpmon-gatherer: The background data gatherer (
APP/openvpn_gatherer_v3.py). - ovpmon-profiler: The new FastAPI profiler module (
NEW_MODULES/main.py).
Common Prerequisites
- Install Directory:
/opt/ovpmon(Recommended) - Virtual Environment:
/opt/ovpmon/venv
1. Alpine Linux (OpenRC)
Installation
-
Copy Service Scripts: Copy the scripts from
Deployment/APP/openrc/to/etc/init.d/.cp DOCS/General/openrc/ovpmon-api /etc/init.d/ cp DOCS/General/openrc/ovpmon-gatherer /etc/init.d/ cp DOCS/General/openrc/ovpmon-profiler /etc/init.d/ -
Set Permissions:
chmod +x /etc/init.d/ovpmon-* -
Enable Services:
rc-update add ovpmon-api default rc-update add ovpmon-gatherer default rc-update add ovpmon-profiler default -
Start Services:
rc-service ovpmon-api start rc-service ovpmon-gatherer start rc-service ovpmon-profiler start
Configuration
To override defaults (e.g., if you installed to a different directory), create files in /etc/conf.d/:
File: /etc/conf.d/ovpmon-api (example)
directory="/var/www/my-monitoring"
command_args="/var/www/my-monitoring/APP_CORE/openvpn_api_v3.py"
2. Debian / Ubuntu (Systemd)
Installation Steps
-
Copy Service Files: Copy the provided service files from
DOCS/General/systemd/to/etc/systemd/system/.cp DOCS/General/systemd/ovpmon-api.service /etc/systemd/system/ cp DOCS/General/systemd/ovpmon-gatherer.service /etc/systemd/system/ cp DOCS/General/systemd/ovpmon-profiler.service /etc/systemd/system/ -
Reload Daemon:
systemctl daemon-reload -
Enable Services (Start on boot):
systemctl enable ovpmon-api ovpmon-gatherer ovpmon-profiler -
Start Services:
systemctl start ovpmon-api ovpmon-gatherer ovpmon-profiler -
Check Status:
systemctl status ovpmon-api