Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177563221
D14556.1794738275.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
8 KB
Referenced Files
None
Subscribers
None
D14556.1794738275.diff
View Options
Index: Makefile
===================================================================
--- Makefile
+++ Makefile
@@ -19,7 +19,7 @@
GO_PKGNAME= github.com/${PORTNAME}/${PORTNAME}
-USE_RC_SUBR= prometheus
+USE_RC_SUBR= prometheus1
USERS= prometheus
GROUPS= prometheus
@@ -32,18 +32,22 @@
${LD_FLAG_X_PREFIX}.Branch=release-${PORTVERSION:R} \
${LD_FLAG_X_PREFIX}.BuildUser=${BUILD_USER}
+PROMETHEUS_BINARIES= prometheus promtool
+
do-build:
- ( cd ${GO_WRKSRC}/cmd/prometheus ; \
+.for bin in ${PROMETHEUS_BINARIES}
+ ( cd ${GO_WRKSRC}/cmd/${bin} ; \
${SETENV} ${MAKE_ENV} ${GO_ENV} go install -ldflags "${LD_FLAG_STRING}" )
+.endfor
- ( cd ${GO_WRKSRC}/cmd/promtool ; \
- ${SETENV} ${MAKE_ENV} ${GO_ENV} go install -ldflags "${LD_FLAG_STRING}" )
-
do-install:
- ${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/prometheus ${STAGEDIR}${PREFIX}/bin
- ${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/promtool ${STAGEDIR}${PREFIX}/bin
- ${INSTALL_DATA} ${WRKSRC}/documentation/examples/prometheus.yml ${STAGEDIR}${LOCALBASE}/etc/prometheus.yml.sample
+.for bin in ${PROMETHEUS_BINARIES}
+ ${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/${bin} ${STAGEDIR}${PREFIX}/bin/${bin}1
+.endfor
+ ${INSTALL_DATA} \
+ ${WRKSRC}/documentation/examples/prometheus.yml \
+ ${STAGEDIR}${LOCALBASE}/etc/prometheus1.yml.sample
- ${MKDIR} ${STAGEDIR}${DESTDIR}/var/db/prometheus
+ ${MKDIR} ${STAGEDIR}${DESTDIR}/var/db/prometheus1
.include <bsd.port.mk>
Index: files/prometheus.in
===================================================================
--- files/prometheus.in
+++ files/prometheus.in
@@ -1,65 +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/prometheus.pid
-required_files="${prometheus_config}"
-command="/usr/sbin/daemon"
-procname="%%PREFIX%%/bin/prometheus"
-sig_reload=HUP
-extra_commands="reload"
-command_args="-p ${pidfile} /usr/bin/env ${procname} \
- -config.file=${prometheus_config} \
- -storage.local.path=${prometheus_data_dir} \
- ${prometheus_args} >> ${prometheus_log_file} 2>&1"
-
-start_precmd=prometheus_startprecmd
-
-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}
- fi
-}
-
-load_rc_config $name
-run_rc_command "$1"
Index: files/prometheus1.in
===================================================================
--- files/prometheus1.in
+++ files/prometheus1.in
@@ -1,63 +1,75 @@
#!/bin/sh
-# PROVIDE: prometheus
+# PROVIDE: prometheus1
# 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 ""
+# prometheus1_enable (bool): Set to NO by default
+# Set it to YES to enable prometheus1
+# prometheus1_user (string): Set user to run prometheus
+# Default is "prometheus"
+# prometheus1_group (string): Set group to run prometheus
+# Default is "prometheus"
+# prometheus1_data_dir (string): Set dir to run prometheus in
+# Default is "/var/db/prometheus1"
+# prometheus1_log_file (string): Set file that prometheus will log to
+# Default is "/var/log/prometheus1.log"
+# prometheus1_args (string): Set additional command line arguments
+# Default is ""
. /etc/rc.subr
-name=prometheus
-rcvar=prometheus_enable
+name=prometheus1
+rcvar=prometheus1_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:=""}
+: ${prometheus1_enable:="NO"}
+: ${prometheus1_user:="prometheus"}
+: ${prometheus1_group:="prometheus"}
+: ${prometheus1_config:="%%PREFIX%%/etc/prometheus1.yml"}
+: ${prometheus1_data_dir:="/var/db/prometheus1"}
+: ${prometheus1_log_file:="/var/log/prometheus1.log"}
+: ${prometheus1_args:=""}
-pidfile=/var/run/prometheus.pid
-required_files="${prometheus_config}"
+pidfile=/var/run/${name}.pid
+required_files="${prometheus1_config}"
command="/usr/sbin/daemon"
-procname="%%PREFIX%%/bin/prometheus"
+procname="%%PREFIX%%/bin/prometheus1"
sig_reload=HUP
extra_commands="reload"
command_args="-p ${pidfile} /usr/bin/env ${procname} \
- -config.file=${prometheus_config} \
- -storage.local.path=${prometheus_data_dir} \
- ${prometheus_args} >> ${prometheus_log_file} 2>&1"
+ -config.file=${prometheus1_config} \
+ -storage.local.path=${prometheus1_data_dir} \
+ ${prometheus1_args} >> ${prometheus1_log_file} 2>&1"
start_precmd=prometheus_startprecmd
-prometheus_startprecmd()
+prometheus1_startprecmd()
{
if [ ! -e ${pidfile} ]; then
- install -o ${prometheus_user} -g ${prometheus_group} /dev/null ${pidfile};
+ install \
+ -o ${prometheus1_user} \
+ -g ${prometheus1_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};
+ if [ ! -f "${prometheus1_log_file}" ]; then
+ install \
+ -o ${prometheus1_user} \
+ -g ${prometheus1_group} \
+ -m 640 \
+ /dev/null ${prometheus1_log_file};
fi
- if [ ! -d ${prometheus_data_dir} ]; then
- install -d -o ${prometheus_user} -g ${prometheus_group} -m 750 ${prometheus_data_dir}
+ if [ ! -d ${prometheus1_data_dir} ]; then
+ install \
+ -d \
+ -o ${prometheus1_user} \
+ -g ${prometheus1_group} \
+ -m 750 \
+ ${prometheus1_data_dir}
fi
}
Index: pkg-plist
===================================================================
--- pkg-plist
+++ pkg-plist
@@ -1,4 +1,4 @@
-bin/prometheus
-bin/promtool
-@sample etc/prometheus.yml.sample
-@dir(prometheus,prometheus) /var/db/prometheus
+bin/prometheus1
+bin/promtool1
+@sample etc/prometheus1.yml.sample
+@dir(prometheus,prometheus) /var/db/prometheus1
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 15, 10:24 AM (22 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41741631
Default Alt Text
D14556.1794738275.diff (8 KB)
Attached To
Mode
D14556: net-mgmt/prometheus1: rc script move and rcvar rename.
Attached
Detach File
Event Timeline