aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt
diff options
context:
space:
mode:
authorBoris Korzun <drtr0jan@yandex.ru>2023-12-28 16:54:28 +0000
committerFernando ApesteguĂ­a <fernape@FreeBSD.org>2023-12-28 17:09:50 +0000
commitb534a3d03a7dfab1f70b755b668d0feab4b40bb5 (patch)
treefff5da47c87bf6fc3c482e5cd6a89bae0d67f37f /net-mgmt
parent426da115bce9dcbc7945289c17ded11aa77934d2 (diff)
downloadports-b534a3d03a7dfab1f70b755b668d0feab4b40bb5.tar.gz
ports-b534a3d03a7dfab1f70b755b668d0feab4b40bb5.zip
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/ping_exporter/Makefile11
-rw-r--r--net-mgmt/ping_exporter/distinfo10
-rw-r--r--net-mgmt/ping_exporter/files/ping_exporter.in47
-rw-r--r--net-mgmt/ping_exporter/pkg-plist2
4 files changed, 22 insertions, 48 deletions
diff --git a/net-mgmt/ping_exporter/Makefile b/net-mgmt/ping_exporter/Makefile
index 250690306d90..f833b41a2b42 100644
--- a/net-mgmt/ping_exporter/Makefile
+++ b/net-mgmt/ping_exporter/Makefile
@@ -1,24 +1,19 @@
PORTNAME= ping_exporter
-DISTVERSION= 1.0.1
-PORTREVISION= 9
+DISTVERSION= 1.1.0
CATEGORIES= net-mgmt
-MASTER_SITES= https://raw.githubusercontent.com/czerwonk/ping_exporter/${DISTVERSIONFULL}/:gomod
-DISTFILES= go.mod:gomod
MAINTAINER= jp+ports@supplntr.io
COMMENT= Prometheus exporter for ICMP echo requests
WWW= https://github.com/czerwonk/ping_exporter
-LICENSE= APACHE20
+LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= go:modules
-USE_GITHUB= yes
-GH_ACCOUNT= czerwonk
USE_RC_SUBR= ping_exporter
-GO_MODULE= github.com/czerwonk/ping_exporter
+GO_MODULE= github.com/czerwonk/ping_exporter@v0.0.0-20230519045214-d3a6779128c3
SUB_FILES= pkg-message
diff --git a/net-mgmt/ping_exporter/distinfo b/net-mgmt/ping_exporter/distinfo
index e9ba5e88048f..06ccc3e0142e 100644
--- a/net-mgmt/ping_exporter/distinfo
+++ b/net-mgmt/ping_exporter/distinfo
@@ -1,5 +1,5 @@
-TIMESTAMP = 1669193030
-SHA256 (go/net-mgmt_ping_exporter/czerwonk-ping_exporter-1.0.1_GH0/go.mod) = b824d4e9c3b5f990ceca986be7f61f2e106ab1bda8b313938da0201b804e554d
-SIZE (go/net-mgmt_ping_exporter/czerwonk-ping_exporter-1.0.1_GH0/go.mod) = 973
-SHA256 (go/net-mgmt_ping_exporter/czerwonk-ping_exporter-1.0.1_GH0/czerwonk-ping_exporter-1.0.1_GH0.tar.gz) = bbd1db514e2f93859d82f40821524b374d3f105f3bcdf4e5290b0404d699f4f7
-SIZE (go/net-mgmt_ping_exporter/czerwonk-ping_exporter-1.0.1_GH0/czerwonk-ping_exporter-1.0.1_GH0.tar.gz) = 42870
+TIMESTAMP = 1702027163
+SHA256 (go/net-mgmt_ping_exporter/ping_exporter-1.1.0/v0.0.0-20230519045214-d3a6779128c3.mod) = b926c2b2def80e683cd4645ea61b5a6aaf04f492d68bf17a9d5ef951fe3e3b30
+SIZE (go/net-mgmt_ping_exporter/ping_exporter-1.1.0/v0.0.0-20230519045214-d3a6779128c3.mod) = 2212
+SHA256 (go/net-mgmt_ping_exporter/ping_exporter-1.1.0/v0.0.0-20230519045214-d3a6779128c3.zip) = 1223f3c3761dbc532f1c8641129602956ccaf44c073754e8b9a491b252d6dfa9
+SIZE (go/net-mgmt_ping_exporter/ping_exporter-1.1.0/v0.0.0-20230519045214-d3a6779128c3.zip) = 51347
diff --git a/net-mgmt/ping_exporter/files/ping_exporter.in b/net-mgmt/ping_exporter/files/ping_exporter.in
index 898719fbd53c..9408980ab5dd 100644
--- a/net-mgmt/ping_exporter/files/ping_exporter.in
+++ b/net-mgmt/ping_exporter/files/ping_exporter.in
@@ -3,21 +3,13 @@
# PROVIDE: ping_exporter
# REQUIRE: LOGIN
# KEYWORD: shutdown
-#
+
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# ping_exporter_enable (bool): Set to NO by default.
# Set it to YES to enable ping_exporter.
-# ping_exporter_user (string): Set user that ping_exporter will run under
-# Default is "nobody".
-# ping_exporter_group (string): Set group that ping_exporter will run under
-# Default is "nobody".
-# ping_exporter_args (string): Set extra arguments to pass to ping_exporter
-# Default is "".
-# ping_exporter_listen_address (string): Set ip:port that ping_exporter will listen on
-# Default is "localhost:9427".
-# ping_exporter_config (string): Set configuration file of ping_exporter
+# ping_exporter_config (str): Set configuration file of ping_exporter
# Default is "%%PREFIX%%/etc/ping_exporter.yml".
# ping_exporter_syslog_output_enable (bool): Set to YES to enable syslog output
# Default is "YES". See daemon(8).
@@ -27,7 +19,10 @@
# Default is "notice". See daemon(8).
# ping_exporter_syslog_output_facility (str): Set to YES to enable syslog output
# Default is "daemon". See daemon(8).
-
+# ping_exporter_listen_address (string): Set ip:port that ping_exporter will listen on
+# Default is "localhost:9427".
+# ping_exporter_args (str): Set extra arguments to pass to ping_exporter
+# Default is "".
. /etc/rc.subr
@@ -38,13 +33,9 @@ rcvar=ping_exporter_enable
load_rc_config $name
: ${ping_exporter_enable:=NO}
-: ${ping_exporter_user:=nobody}
-: ${ping_exporter_group:=nobody}
-: ${ping_exporter_listen_address=localhost:9427}
: ${ping_exporter_config="%%PREFIX%%/etc/ping_exporter.yml"}
: ${ping_exporter_syslog_output_enable:="YES"}
-
-start_precmd=ping_exporter_startprecmd
+: ${ping_exporter_listen_address=localhost:9427}
if checkyesno ping_exporter_syslog_output_enable; then
if [ -n "${ping_exporter_syslog_output_tag}" ]; then
@@ -60,24 +51,14 @@ if checkyesno ping_exporter_syslog_output_enable; then
fi
fi
-pidfile=/var/run/ping_exporter.pid
-procname="%%PREFIX%%/bin/ping_exporter"
-required_files="${ping_exporter_config}"
+pidfile=/var/run/${name}.pid
+required_files="${ping_exporter_config}"
command=/usr/sbin/daemon
-command_args="-p ${pidfile} -t ${name} ${ping_exporter_syslog_output_flags} -S \
- /usr/bin/env ${procname} \
- --web.listen-address=${ping_exporter_listen_address} \
- --config.path=${ping_exporter_config} \
- ${ping_exporter_args} 2>&1"
-
-ping_exporter_startprecmd()
-{
- if [ ! -e ${pidfile} ]; then
- install -o ${ping_exporter_user} -g ${ping_exporter_group} /dev/null ${pidfile};
- else
- chown ${ping_exporter_user}:${ping_exporter_group} ${pidfile};
- fi
-}
+command_args="-f -P ${pidfile} -t ${name} ${ping_exporter_syslog_output_flags} \
+ /usr/bin/env ${ping_exporter_env} %%PREFIX%%/bin/ping_exporter \
+ --config.path=${ping_exporter_config} \
+ --web.listen-address=${ping_exporter_listen_address} \
+ ${ping_exporter_args}"
run_rc_command "$1"
diff --git a/net-mgmt/ping_exporter/pkg-plist b/net-mgmt/ping_exporter/pkg-plist
index e5b94c1e9591..e8676dd8f5e2 100644
--- a/net-mgmt/ping_exporter/pkg-plist
+++ b/net-mgmt/ping_exporter/pkg-plist
@@ -1,6 +1,4 @@
-@mode 4755
bin/ping_exporter
-@mode
@sample %%ETCDIR%%.yml.sample
%%DATADIR%%/newsyslog.conf.d/ping_exporter.conf
%%DATADIR%%/syslog.d/ping_exporter.conf