summaryrefslogtreecommitdiff
path: root/app-metrics/exabgp_exporter/files/exabgp_exporter.initd
blob: b54e95b462229c232db46774716795ea9ea02fd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/sbin/openrc-run
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

description="Prometheus exporter for exabgp"
command="/usr/bin/exabgp_exporter"
command_user="${command_user:-exabgp:exabgp}"
command_args="${command_args:-standalone}"
command_background=yes
error_log="${error_log:-/var/log/${RC_SVCNAME}/${RC_SVCNAME}.log}"
output_log="${output_log:-/var/log/${RC_SVCNAME}/${RC_SVCNAME}.log}"
pidfile="${pidfile:-/run/${RC_SVCNAME}.pid}"
start_stop_daemon_args="--user ${command_user%:*} --group ${command_user#*:}"
: "${supervisor:=supervise-daemon}"
: "${respawn_delay:=5}"
: "${respawn_max:=0}"

start() {
	checkpath --directory --owner "${command_user}" "${error_log%/*}" "${output_log%/*}"
	default_start
}