diff options
author | Brad Davis <brd@FreeBSD.org> | 2018-03-31 06:29:50 +0800 |
---|---|---|
committer | Brad Davis <brd@FreeBSD.org> | 2018-03-31 06:29:50 +0800 |
commit | 4b3b9bdf047c7388e1aa10efaf2d2654accfa10d (patch) | |
tree | 8e3aba6248f915124449913aff722dc3151b7f5b /net-mgmt/prometheus2/files/prometheus.in | |
parent | 1f4fec42969873f709b90dc18dac0f06be986cf5 (diff) | |
download | freebsd-ports-gnome-4b3b9bdf047c7388e1aa10efaf2d2654accfa10d.tar.gz freebsd-ports-gnome-4b3b9bdf047c7388e1aa10efaf2d2654accfa10d.tar.zst freebsd-ports-gnome-4b3b9bdf047c7388e1aa10efaf2d2654accfa10d.zip |
Remove to fix history
PR: 225169
Reported by: mat
Diffstat (limited to 'net-mgmt/prometheus2/files/prometheus.in')
-rw-r--r-- | net-mgmt/prometheus2/files/prometheus.in | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/net-mgmt/prometheus2/files/prometheus.in b/net-mgmt/prometheus2/files/prometheus.in deleted file mode 100644 index 73814e4591e5..000000000000 --- a/net-mgmt/prometheus2/files/prometheus.in +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -# PROVIDE: prometheus -# REQUIRE: LOGIN -# KEYWORD: shutdown -# -# Add the following lines to /etc/rc.conf.local or /etc/rc.conf -# to enable this service: -# -# prometheus_enable (bool): Set to NO by default -# Set it to YES to enable prometheus -# prometheus_user (string): Set user to run prometheus -# Default is "prometheus" -# prometheus_group (string): Set group to run prometheus -# Default is "prometheus" -# prometheus_data_dir (string): Set dir to run prometheus in -# Default is "/var/db/prometheus" -# prometheus_log_file (string): Set file that prometheus will log to -# Default is "/var/log/prometheus.log" -# prometheus_args (string): Set additional command line arguments -# Default is "" - -. /etc/rc.subr - -name=prometheus -rcvar=prometheus_enable - -load_rc_config $name - -: ${prometheus_enable:="NO"} -: ${prometheus_user:="prometheus"} -: ${prometheus_group:="prometheus"} -: ${prometheus_config:="%%PREFIX%%/etc/prometheus.yml"} -: ${prometheus_data_dir:="/var/db/prometheus"} -: ${prometheus_log_file:="/var/log/prometheus.log"} -: ${prometheus_args:=""} - -pidfile="/var/run/${name}.pid" -required_files="${prometheus_config}" -command="/usr/sbin/daemon" -procname="%%PREFIX%%/bin/${name}" -sig_reload="HUP" -extra_commands="reload" -command_args="-p ${pidfile} /usr/bin/env ${procname} \ - --config.file=${prometheus_config} \ - --storage.tsdb.path=${prometheus_data_dir} \ - ${prometheus_args} >> ${prometheus_log_file} 2>&1" - -start_precmd=prometheus_startprecmd - -# This checks for the existence of a prometheus 1.x data dir at the -# $prometheus_data_dir location. If one is found, Prometheus will not start. -prometheus_check_data_dir_version() -{ - local data_dir_version_file="${prometheus_data_dir}/VERSION" - - if [ -f "${data_dir_version_file}" ]; then - local data_dir_version="0" - - read data_dir_version < "${data_dir_version_file}" - - if [ "${data_dir_version}" = "1" ]; then - return 1 - fi - fi -} - -prometheus_startprecmd() -{ - if [ ! -e ${pidfile} ]; then - install \ - -o ${prometheus_user} \ - -g ${prometheus_group} \ - /dev/null ${pidfile}; - fi - if [ ! -f "${prometheus_log_file}" ]; then - install \ - -o ${prometheus_user} \ - -g ${prometheus_group} \ - -m 640 \ - /dev/null ${prometheus_log_file}; - fi - if [ ! -d ${prometheus_data_dir} ]; then - install \ - -d \ - -o ${prometheus_user} \ - -g ${prometheus_group} \ - -m 750 \ - ${prometheus_data_dir} - else - # The directory already existed. Ensure it's not a prometheus 1.x - # data dir. - if ! prometheus_check_data_dir_version; then - err 1 "Found net-mgmt/prometheus1 data dir, refusing to start." - fi - fi -} - -load_rc_config $name -run_rc_command "$1" |