Files

36 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

2026-01-09 01:05:50 +03:00
#!/sbin/openrc-run
# 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),
# OpenRC (Alpine). Install: see ovpmon-api. Settings come from /etc/ovpmon/env.
# The gatherer keeps running while OpenVPN is down (it waits for the status log).
2026-01-09 01:05:50 +03:00
name="ovpmon-gatherer"
description="OpenVPN Monitor Gatherer"
2026-01-09 01:05:50 +03:00
supervisor="supervise-daemon"
respawn_delay=3
respawn_max=0
2026-01-09 01:05:50 +03:00
command_user="ovpmon:ovpmon"
directory="/opt/OpenVPN-Monitoring-Simple/APP_CORE"
command="/opt/OpenVPN-Monitoring-Simple/APP_CORE/venv/bin/python"
command_args="openvpn_gatherer_v3.py"
2026-01-09 01:05:50 +03:00
output_log="/var/log/ovpmon/ovpmon-gatherer.log"
error_log="/var/log/ovpmon/ovpmon-gatherer.log"
2026-01-09 01:05:50 +03:00
depend() {
need net
after firewall
}
start_pre() {
checkpath -f -m 0640 -o ovpmon:ovpmon "$output_log" || return 1
[ -r /etc/ovpmon/env ] || { eerror "/etc/ovpmon/env is missing"; return 1; }
set -a
. /etc/ovpmon/env
set +a
# extend, never replace: OpenRC itself needs /lib/rc/bin (ebegin, eend) on the PATH
export PATH="/usr/local/sbin:/usr/local/bin:$PATH"
}