diff --git a/databases/prometheus-postgres-exporter/Makefile b/databases/prometheus-postgres-exporter/Makefile index 4fea7f72e1b2..e130388a7645 100644 --- a/databases/prometheus-postgres-exporter/Makefile +++ b/databases/prometheus-postgres-exporter/Makefile @@ -1,29 +1,29 @@ PORTNAME= prometheus-postgres-exporter DISTVERSIONPREFIX= v DISTVERSION= 0.18.1 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= databases MAINTAINER= ivy@FreeBSD.org COMMENT= PostgreSQL metric exporter for Prometheus WWW= https://github.com/prometheus-community/postgres_exporter LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE USES= go:modules USE_RC_SUBR= postgres_exporter GO_MODULE= github.com/prometheus-community/postgres_exporter GO_TARGET= ./cmd/postgres_exporter:${PREFIX}/bin/postgres_exporter SUB_FILES= pkg-message PLIST_FILES= bin/postgres_exporter \ etc/postgres_exporter.yml.sample post-install: @${MKDIR} ${STAGEDIR}${PREFIX}/etc ${INSTALL_DATA} ${PATCHDIR}/postgres_exporter.yml.sample \ ${STAGEDIR}${PREFIX}/etc/postgres_exporter.yml.sample .include diff --git a/databases/prometheus-postgres-exporter/files/postgres_exporter.in b/databases/prometheus-postgres-exporter/files/postgres_exporter.in index e96e638fa152..e6c0f93fdfc9 100644 --- a/databases/prometheus-postgres-exporter/files/postgres_exporter.in +++ b/databases/prometheus-postgres-exporter/files/postgres_exporter.in @@ -1,73 +1,78 @@ #!/bin/sh # PROVIDE: postgres_exporter # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # # postgres_exporter_enable (bool): Set to NO by default. # Set it to YES to enable postgres_exporter. # postgres_exporter_config_file (string): Set the configuration file. # Default is "%%PREFIX%%/etc/postgres_exporter.yml". # postgres_exporter_user (string): Set user that postgres_exporter will run under # Default is "nobody". # postgres_exporter_group (string): Set group that postgres_exporter will run under # Default is "nobody". # postgres_exporter_args (string): Set extra arguments to pass to postgres_exporter # Default is "". +# postgres_exporter_env (string) Set environment passed to postgres_exporter. +# A series of VAR=value pairs. If not using multi-target mode, +# this may be used to set the target DSN via $DATA_SOURCE_URI. +# Default is "". # postgres_exporter_listen_address (string):Set ip:port that postgres_exporter will listen on # Default is "localhost:9187". # postgres_exporter_syslog_output_tag (str): Set syslog tag. # Default is "postgres_exporter". See daemon(8). # postgres_exporter_syslog_output_priority (str): Set syslog priority. # Default is "notice". See daemon(8). # postgres_exporter_syslog_output_facility (str): Set syslog facility. # Default is "daemon". See daemon(8). . /etc/rc.subr name=postgres_exporter rcvar=postgres_exporter_enable load_rc_config $name : ${postgres_exporter_enable:="NO"} : ${postgres_exporter_config_file:="%%PREFIX%%/etc/postgres_exporter.yml"} : ${postgres_exporter_user:="nobody"} : ${postgres_exporter_group:="nobody"} : ${postgres_exporter_args:=""} +: ${postgres_exporter_env:=""} : ${postgres_exporter_listen_address:="localhost:9187"} : ${postgres_exporter_syslog_output_tag=${name}} : ${postgres_exporter_syslog_output_priority=notice} : ${postgres_exporter_syslog_output_facility=daemon} pidfile=/var/run/postgres_exporter.pid command="/usr/sbin/daemon" procname="%%PREFIX%%/bin/postgres_exporter" command_args="-f -p ${pidfile} -t ${name} \ -T ${postgres_exporter_syslog_output_tag} \ -s ${postgres_exporter_syslog_output_priority} \ -l ${postgres_exporter_syslog_output_facility} \ - /usr/bin/env ${procname} \ + /usr/bin/env ${postgres_exporter_env} ${procname} \ --web.listen-address=${postgres_exporter_listen_address} \ --config.file=${postgres_exporter_config_file} \ ${postgres_exporter_args}" start_precmd=postgres_exporter_startprecmd postgres_exporter_startprecmd() { if [ ! -e ${pidfile} ]; then install \ -o ${postgres_exporter_user} \ -g ${postgres_exporter_group} \ /dev/null ${pidfile}; fi } load_rc_config $name run_rc_command "$1"