39 lines
1.5 KiB
Plaintext
39 lines
1.5 KiB
Plaintext
|
#!/bin/sh
|
||
|
|
||
|
# $FreeBSD: head/net/dovecot_exporter/files/dovecot_exporter.in 529909 2020-03-30 19:18:03Z decke $
|
||
|
#
|
||
|
# PROVIDE: dovecot_exporter
|
||
|
# REQUIRE: DAEMON
|
||
|
# KEYWORD: shutdown
|
||
|
#
|
||
|
# dovecot_exporter_enable (bool): Set to "YES" to enable dovecot_exporter.
|
||
|
# (default: "NO")
|
||
|
#
|
||
|
# dovecot_exporter_socket (str): Dovecot socket path
|
||
|
# (default: "/var/run/dovecot/stats-reader")
|
||
|
# dovecot_exporter_listen (str): Exporter listening address
|
||
|
# (default: ":9166")
|
||
|
# dovecot_exporter_telemetry_path (str): Path under which to expose metrics
|
||
|
# (default: "/metrics")
|
||
|
# dovecot_exporter_stats_scopes (str): Stats scopes to query (comma separated)
|
||
|
|
||
|
. /etc/rc.subr
|
||
|
|
||
|
name=dovecot_exporter
|
||
|
rcvar=dovecot_exporter_enable
|
||
|
|
||
|
load_rc_config $name
|
||
|
|
||
|
: ${dovecot_exporter_enable="NO"}
|
||
|
: ${dovecot_exporter_socket="/var/run/dovecot/stats-reader"}
|
||
|
: ${dovecot_exporter_listen=":9166"}
|
||
|
: ${dovecot_exporter_telemetry_path="/metrics"}
|
||
|
: ${dovecot_exporter_pidfile:="/var/run/dovecot_exporter.pid"}
|
||
|
: ${dovecot_exporter_user:="dovecot_exporter"}
|
||
|
|
||
|
command="/usr/local/bin/dovecot_exporter"
|
||
|
command_args="--web.listen-address=\${dovecot_exporter_listen} --web.telemetry-path=\${dovecot_exporter_telemetry_path} --dovecot.socket-path=\${dovecot_exporter_showq} --dovecot.scopes=\${dovecot_exporter_stats_scopes}"
|
||
|
start_cmd="/usr/sbin/daemon -u ${dovecot_exporter_user} ${command} ${command_args}"
|
||
|
|
||
|
run_rc_command "$1"
|