diff --git a/net-mgmt/victoria-logs/Makefile b/net-mgmt/victoria-logs/Makefile index e7380379639c..ae5f430c17ce 100644 --- a/net-mgmt/victoria-logs/Makefile +++ b/net-mgmt/victoria-logs/Makefile @@ -1,60 +1,64 @@ PORTNAME= victoria-logs PORTVERSION= 1.45.0 DISTVERSIONPREFIX= v +PORTREVISION= 1 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 # we have to use github, as goproxy tags are wrong # see https://github.com/VictoriaMetrics/VictoriaLogs/issues/1071 USE_GITHUB= yes GH_ACCOUNT= VictoriaMetrics GH_PROJECT= VictoriaLogs USE_RC_SUBR?= victoria_logs GO_MOD_DIST= github GO_MODULE= github.com/${GH_ACCOUNT}/${GH_PROJECT} MAKE_ENV= BUILDINFO_TAG=tags-v${PORTVERSION}-victorialogs \ DATEINFO_TAG=${_GET_DATE:sh} \ GOFLAGS=-buildvcs=false \ GOOS=${OPSYS:tl} \ PKG_TAG=v${PORTVERSION} ALL_TARGET= ${PORTNAME}-pure vlogscli-pure vmalert-pure SUB_LIST+= VICTORIA_DATA=${VICTORIA_DATA} \ + VICTORIA_LOGS=${VICTORIA_LOGS} \ VICTORIA_USER=${USERS} USERS= victoria-logs GROUPS= victoria-logs VICTORIA_DATA?= /var/db/victoria-logs +VICTORIA_LOGS?= /var/log/victoria_logs PLIST_SUB+= VICTORIA_DATA=${VICTORIA_DATA} \ VICTORIA_GROUP=${GROUPS} \ + VICTORIA_LOGS=${VICTORIA_LOGS} \ 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} + @${MKDIR} ${STAGEDIR}${VICTORIA_DATA} ${STAGEDIR}${VICTORIA_LOGS} 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 4462872ed86b..715e8fba04cb 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: 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}" +logdir="%%VICTORIA_LOGS%%" 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" diff --git a/net-mgmt/victoria-logs/pkg-plist b/net-mgmt/victoria-logs/pkg-plist index 88f32a70c9f9..2bc997d481b8 100644 --- a/net-mgmt/victoria-logs/pkg-plist +++ b/net-mgmt/victoria-logs/pkg-plist @@ -1,55 +1,56 @@ bin/victoria-logs bin/vlogscli %%PORTDOCS%%%%DOCSDIR%%/CHANGELOG.md %%PORTDOCS%%%%DOCSDIR%%/FAQ.md %%PORTDOCS%%%%DOCSDIR%%/QuickStart.md %%PORTDOCS%%%%DOCSDIR%%/README.md %%PORTDOCS%%%%DOCSDIR%%/Roadmap.md %%PORTDOCS%%%%DOCSDIR%%/data-ingestion/Filebeat.md %%PORTDOCS%%%%DOCSDIR%%/data-ingestion/Fluentbit.md %%PORTDOCS%%%%DOCSDIR%%/data-ingestion/Logstash.md %%PORTDOCS%%%%DOCSDIR%%/data-ingestion/Promtail.md %%PORTDOCS%%%%DOCSDIR%%/data-ingestion/README.md %%PORTDOCS%%%%DOCSDIR%%/data-ingestion/Vector.md %%PORTDOCS%%%%DOCSDIR%%/data-ingestion/syslog.md %%PORTDOCS%%%%DOCSDIR%%/keyConcepts.md %%PORTDOCS%%%%DOCSDIR%%/logsql-examples.md %%PORTDOCS%%%%DOCSDIR%%/querying/README.md %%PORTDOCS%%%%DOCSDIR%%/victorialogs-datasource.md %%PORTDOCS%%%%DOCSDIR%%/_index.md %%PORTDOCS%%%%DOCSDIR%%/data-ingestion/Telegraf.md %%PORTDOCS%%%%DOCSDIR%%/data-ingestion/_index.md %%PORTDOCS%%%%DOCSDIR%%/data-ingestion/opentelemetry.md %%PORTDOCS%%%%DOCSDIR%%/provision_datasources.webp %%PORTDOCS%%%%DOCSDIR%%/querying/_index.md %%PORTDOCS%%%%DOCSDIR%%/data-ingestion/Fluentd.md %%PORTDOCS%%%%DOCSDIR%%/ha-victorialogs-single-node.webp %%PORTDOCS%%%%DOCSDIR%%/querying/vlogscli.md %%PORTDOCS%%%%DOCSDIR%%/data-ingestion/DataDogAgent.md %%PORTDOCS%%%%DOCSDIR%%/data-ingestion/Journald.md %%PORTDOCS%%%%DOCSDIR%%/vmalert.md %%PORTDOCS%%%%DOCSDIR%%/vmalert_victorialogs.excalidraw %%PORTDOCS%%%%DOCSDIR%%/vmalert_victorialogs.webp %%PORTDOCS%%%%DOCSDIR%%/cluster.md %%PORTDOCS%%%%DOCSDIR%%/logql-to-logsql.md %%PORTDOCS%%%%DOCSDIR%%/sql-to-logsql.md %%PORTDOCS%%%%DOCSDIR%%/Articles.md %%PORTDOCS%%%%DOCSDIR%%/Release-Guide.md %%PORTDOCS%%%%DOCSDIR%%/security-and-lb.md %%PORTDOCS%%%%DOCSDIR%%/vlagent.md %%PORTDOCS%%%%DOCSDIR%%/metrics.md %%PORTDOCS%%%%DOCSDIR%%/vlagent-metrics.md %%PORTDOCS%%%%DOCSDIR%%/logsql.md %%PORTDOCS%%%%DOCSDIR%%/integrations/_index.md %%PORTDOCS%%%%DOCSDIR%%/integrations/perses-datasource.webp %%PORTDOCS%%%%DOCSDIR%%/integrations/perses-logs-panel.webp %%PORTDOCS%%%%DOCSDIR%%/integrations/perses-overview.webp %%PORTDOCS%%%%DOCSDIR%%/integrations/perses-time-panel.webp %%PORTDOCS%%%%DOCSDIR%%/integrations/perses-variable.webp %%PORTDOCS%%%%DOCSDIR%%/integrations/perses.md %%PORTDOCS%%%%DOCSDIR%%/querying/vlogscli_common_flags.md %%PORTDOCS%%%%DOCSDIR%%/victoria_logs_common_flags.md %%PORTDOCS%%%%DOCSDIR%%/victoria_logs_enterprise_flags.md %%PORTDOCS%%%%DOCSDIR%%/vlagent_common_flags.md %%PORTDOCS%%%%DOCSDIR%%/vlagent_enterprise_flags.md @dir(%%VICTORIA_USER%%,%%VICTORIA_GROUP%%,750) %%VICTORIA_DATA%% +@dir(%%VICTORIA_USER%%,%%VICTORIA_GROUP%%,750) %%VICTORIA_LOGS%%