Files

31 lines
2.1 KiB
Markdown
Raw Permalink Normal View History

2026-01-28 22:37:47 +03:00
# Service Setup Guide
The OpenVPN Monitor components run as three system services under the unprivileged user `ovpmon`. `deploy/native/install.sh` installs and enables them (see [System services](README.md)); this page is the day-to-day reference.
2026-01-28 22:37:47 +03:00
| Service | Command (working directory under the install dir, default `/opt/OpenVPN-Monitoring-Simple`) | Listens |
|---|---|---|
| `ovpmon-api` | `APP_CORE/venv/bin/python -m gunicorn -w 2 -b 127.0.0.1:5001 openvpn_api_v3:app` | 127.0.0.1:5001 |
| `ovpmon-gatherer` | `APP_CORE/venv/bin/python openvpn_gatherer_v3.py` | - |
| `ovpmon-profiler` | `APP_PROFILER/venv/bin/python -m uvicorn main:app --host 127.0.0.1 --port 8000` | 127.0.0.1:8000 |
2026-01-28 22:37:47 +03:00
Settings: `/etc/ovpmon/env` (`root:root` 600). The services start after the network and do not depend on OpenVPN.
2026-01-28 22:37:47 +03:00
## Definitions
2026-01-28 22:37:47 +03:00
- Alpine (OpenRC): [`openrc/ovpmon-*`](../../General/openrc/INSTALL.md) in `/etc/init.d/` (`supervise-daemon`, `command_user=ovpmon:ovpmon`, environment sourced in `start_pre`, log in `/var/log/ovpmon/`).
- Debian / Ubuntu (../../General/systemd): [`systemd/ovpmon-*.service`](../../General/systemd) in `/etc/systemd/system/` (`User=ovpmon`, `EnvironmentFile=/etc/ovpmon/env`, moderate hardening, log in the journal).
2026-01-28 22:37:47 +03:00
Install them with the scripts (they adjust the install directory); by hand, copy a file, replace `/opt/OpenVPN-Monitoring-Simple` if needed and enable it as below.
2026-01-28 22:37:47 +03:00
## Commands
2026-01-28 22:37:47 +03:00
| | OpenRC (Alpine) | systemd (Debian, Ubuntu) |
|---|---|---|
| Enable at boot | `rc-update add ovpmon-api default` | `systemctl enable ovpmon-api` |
| Start / stop / restart | `rc-service ovpmon-api start\|stop\|restart` | `systemctl start\|stop\|restart ovpmon-api` |
| Status | `rc-service ovpmon-api status` | `systemctl status ovpmon-api` |
| Log | `tail -f /var/log/ovpmon/ovpmon-api.log` | `journalctl -u ovpmon-api -f` |
| After editing `/etc/ovpmon/env` | restart the services | restart the services |
| After editing a unit file | - | `systemctl daemon-reload` |
2026-01-28 22:37:47 +03:00
The OpenVPN server itself (`openvpn` on Alpine, `openvpn-server@server` on Debian/Ubuntu) is started and stopped from the UI through the root helper (`doas`); it is not an `ovpmon-*` service.