First commit
This commit is contained in:
commit
c9dd3e22a5
31
Makefile
Normal file
31
Makefile
Normal file
@ -0,0 +1,31 @@
|
||||
PORTNAME= carp_exporter
|
||||
DISTVERSIONPREFIX= v
|
||||
DISTVERSION= 1.1
|
||||
CATEGORIES= sysutils
|
||||
MASTER_SITES= https://git.nosd.in/yo/carp_exporter/archive/
|
||||
DISTNAME= ${DISTVERSIONPREFIX}${DISTVERSION}
|
||||
|
||||
MAINTAINER= johan@nosd.in
|
||||
COMMENT= Export CARP status in Prometheus format
|
||||
|
||||
LICENSE= BSD2CLAUSE
|
||||
|
||||
USES= shebangfix python
|
||||
SHEBANG_FILES= *.py
|
||||
|
||||
# Gitea packaging need some tweaks
|
||||
WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION}
|
||||
EXTRACT_AFTER_ARGS= && ( [ -d ${PORTNAME} ] && ${MV} ${PORTNAME} ${PORTNAME}-${DISTVERSION} )
|
||||
|
||||
USERS= nobody
|
||||
GROUPS= nobody
|
||||
|
||||
NO_BUILD= YES
|
||||
NO_TEST= YES
|
||||
|
||||
USE_RC_SUBR= carp_exporter
|
||||
|
||||
do-install:
|
||||
${INSTALL_SCRIPT} ${WRKSRC}/carp_exporter.py ${STAGEDIR}${PREFIX}/bin
|
||||
|
||||
.include <bsd.port.mk>
|
3
distinfo
Normal file
3
distinfo
Normal file
@ -0,0 +1,3 @@
|
||||
TIMESTAMP = 1652872508
|
||||
SHA256 (v1.1.tar.gz) = 206ff06b0d573f648b512de8da191935753a4653ae637d286792d48aa47e5f15
|
||||
SIZE (v1.1.tar.gz) = 1321
|
44
files/carp_exporter.in
Normal file
44
files/carp_exporter.in
Normal file
@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
|
||||
# carp_exporter/files/carp_exporter.in 2021-08-20 09:12:03Z yo $
|
||||
#
|
||||
# PROVIDE: carp_exporter
|
||||
# REQUIRE: DAEMON
|
||||
# KEYWORD: shutdown
|
||||
#
|
||||
# carp_exporter_enable (bool): Set to "YES" to enable carp_exporter.
|
||||
# (default: "NO")
|
||||
#
|
||||
# carp_exporter_listen (str): Exporter listening address - NOT IMPLEMENTED
|
||||
# (default: ":8992")
|
||||
#
|
||||
# carp_exporter_logfile (str): carp_exporter logfile
|
||||
# (default: "/var/log/carp_exporter.log")
|
||||
#
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name=carp_exporter
|
||||
rcvar=carp_exporter_enable
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
: ${carp_exporter_enable="NO"}
|
||||
: ${carp_exporter_listen=":8992"}
|
||||
: ${carp_exporter_pidfile:="/var/run/carp_exporter.pid"}
|
||||
: ${carp_exporter_user:="nobody"}
|
||||
: ${carp_exporter_logfile="/var/log/carp_exporter.log"}
|
||||
|
||||
command="python3"
|
||||
command_args="/usr/local/bin/carp_exporter.py > ${carp_exporter_logfile} 2>&1"
|
||||
start_cmd="/usr/sbin/daemon -u ${carp_exporter_user} ${command} ${command_args}"
|
||||
start_precmd="${name}_prestart"
|
||||
|
||||
carp_exporter_prestart()
|
||||
{
|
||||
touch ${carp_exporter_logfile}
|
||||
chown ${carp_exporter_user} ${carp_exporter_logfile}
|
||||
}
|
||||
|
||||
|
||||
run_rc_command "$1"
|
3
pkg-descr
Normal file
3
pkg-descr
Normal file
@ -0,0 +1,3 @@
|
||||
Export CARP status in Prometheus format.
|
||||
|
||||
WWW: https://git.nosd.in/yo/carp_exporter
|
Loading…
Reference in New Issue
Block a user