diff --git a/net-mgmt/victoria-logs/Makefile b/net-mgmt/victoria-logs/Makefile index 40418334e7f4..8ee6579432ee 100644 --- a/net-mgmt/victoria-logs/Makefile +++ b/net-mgmt/victoria-logs/Makefile @@ -1,52 +1,52 @@ PORTNAME= victoria-logs PORTVERSION= 1.43.1 DISTVERSIONPREFIX= v -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net-mgmt MAINTAINER= samm@FreeBSD.org COMMENT= Fast and easy-to-use, open source logs solution WWW= https://victoriametrics.com/products/victorialogs/ LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE USES= gmake go:1.25+,modules,no_targets GO_MODULE= github.com/VictoriaMetrics/VictoriaLogs USE_RC_SUBR?= ${PORTNAME} MAKE_ENV= PKG_TAG=v${PORTVERSION} GOOS=${OPSYS:tl} \ BUILDINFO_TAG=tags-v${PORTVERSION}-victorialogs \ DATEINFO_TAG=${_GET_DATE:sh} GOFLAGS=-buildvcs=false ALL_TARGET= ${PORTNAME}-pure vlogscli-pure vmalert-pure USERS= victoria-logs GROUPS= victoria-logs VICTORIA_DATA?= /var/db/victoria-logs SUB_LIST+= VICTORIA_DATA=${VICTORIA_DATA} \ VICTORIA_USER=${USERS} PLIST_SUB+= VICTORIA_DATA=${VICTORIA_DATA} \ VICTORIA_GROUP=${GROUPS} \ VICTORIA_USER=${USERS} OPTIONS_DEFINE= DOCS .if !defined(MASTERDIR) do-install: ${INSTALL_PROGRAM} ${INSTALL_WRKSRC}/bin/${PORTNAME}-pure \ ${STAGEDIR}${PREFIX}/bin/${PORTNAME} ${INSTALL_PROGRAM} ${INSTALL_WRKSRC}/bin/vlogscli-pure \ ${STAGEDIR}${PREFIX}/bin/vlogscli @${MKDIR} ${STAGEDIR}${VICTORIA_DATA} do-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${MV} ${INSTALL_WRKSRC}/docs/victorialogs/* ${STAGEDIR}${DOCSDIR} .endif .include _GET_DATE= TZ= ${STAT} -f %Sm -t %Y%m%d-%H%M%S ${WRKSRC}/.gitignore diff --git a/net-mgmt/victoria-logs/files/victoria-logs.in b/net-mgmt/victoria-logs/files/victoria-logs.in index 64e34c4308ae..4462872ed86b 100644 --- a/net-mgmt/victoria-logs/files/victoria-logs.in +++ b/net-mgmt/victoria-logs/files/victoria-logs.in @@ -1,66 +1,66 @@ #!/bin/sh # PROVIDE: victoria_logs -# REQUIRE: NETWORK +# REQUIRE: NETWORKING # BEFORE: DAEMON . /etc/rc.subr name="victoria_logs" desc="Fast and easy-to-use, open source logs solution" rcvar="victoria_logs_enable" pidfile="/var/run/${name}.pid" daemon_pidfile="/var/run/${name}-daemon.pid" logdir="/var/log/${name}" logfile="${logdir}/victoria_logs.log" command="%%PREFIX%%/bin/victoria-logs" victoria_logs_args=${victoria_logs_args-"--storageDataPath=%%VICTORIA_DATA%% --retentionPeriod=1 --httpListenAddr=:9428"} victoria_logs_user="%%VICTORIA_USER%%" load_rc_config ${name} start_cmd="start" stop_cmd="stop" status_cmd="status" extra_commands="reload" start() { [ ! -d ${logdir} ] && mkdir -p ${logdir} touch ${logfile} chown ${victoria_logs_user} ${logdir} ${logfile} /usr/sbin/daemon -u ${victoria_logs_user} -f -R5 -p ${pidfile} -P ${daemon_pidfile} -o ${logfile} ${command} ${victoria_logs_args} } stop() { if [ -f "${daemon_pidfile}" ]; then pids=$( pgrep -F ${daemon_pidfile} 2>&1 ) _err=$? [ ${_err} -eq 0 ] && kill -9 ${pids} && /bin/rm -f ${daemon_pidfile} fi if [ -f "${pidfile}" ]; then pids=$( pgrep -F ${pidfile} 2>&1 ) _err=$? [ ${_err} -eq 0 ] && kill -9 ${pids} && /bin/rm -f ${pidfile} fi } status() { if [ -f "${pidfile}" ]; then pids=$( pgrep -F ${pidfile} 2>&1 ) _err=$? if [ ${_err} -eq 0 ]; then echo "${name} is running as pid ${pids}" exit 0 else echo "wrong pid: ${pids}" exit 1 fi else echo "no pidfile $pidfile" exit 1 fi } run_rc_command "$1"