freebsd-ports/databases/py-powa-collector/files/powa-collector.in
Palle Girgensohn 4f4643368e databases/py-powa-collector: New port
PoWA (PostgreSQL Workload Analyzer) is a performance tool for PostgreSQL
9.4 and newer allowing to collect, aggregate and purge statistics on
multiple PostgreSQL instances from various Stats Extensions.

PoWA-collector is the daemon that gather performance metrics from remote
PostgreSQL instances (optional) on a dedicated repository server.
2024-11-05 21:55:02 +01:00

40 lines
1 KiB
Bash

#!/bin/sh
# PROVIDE: powa-collector
# REQUIRE: LOGIN
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable fluent-bit:
#
# powa_collector_enable (bool): Set to YES to enable fluent-bit
# Default: NO
# powa_collector_config (str): config files to use
# Default: %%ETCDIR%%/fluent-bit.conf
# powa_collector_flags (str): Extra flags passed to fluent-bit
. /etc/rc.subr
name="powa_collector"
rcvar=${name}_enable
load_rc_config $name
: ${powa_collector_enable:="NO"}
: ${powa_collector_user:="nobody"}
: ${powa_collector_group:="nogroup"}
pidfile=/var/run/${name}.pid
procname="%%PREFIX%%/bin/powa-collector.py"
command="/usr/sbin/daemon"
command_args="-H -p ${pidfile} -o /var/log/${name}/${name}.log ${procname}"
start_precmd=powa_collector_startprecmd
powa_collector_startprecmd()
{
install -o ${powa_collector_user} -g ${powa_collector_group} -d /var/log/${name}
if [ ! -e ${pidfile} ]; then
install -o ${powa_collector_user} -g ${powa_collector_group} /dev/null ${pidfile};
fi
}
run_rc_command "$1"