diff --git a/sysutils/fluent-bit/Makefile b/sysutils/fluent-bit/Makefile index a1ddc8129f62..f282c64e9678 100644 --- a/sysutils/fluent-bit/Makefile +++ b/sysutils/fluent-bit/Makefile @@ -1,58 +1,58 @@ PORTNAME= fluent-bit DISTVERSIONPREFIX= v DISTVERSION= 4.2.2 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils MAINTAINER= girgen@FreeBSD.org COMMENT= Fast and lightweight data forwarder WWW= https://fluentbit.io/ LICENSE= APACHE20 BROKEN_mips= fails to build: conflicting types for 'restrict' BROKEN_mips64= fails to build: conflicting types for 'restrict' LIB_DEPENDS= libyaml.so:textproc/libyaml USES= bison cmake:noninja compiler:c11 gmake localbase:ldflags USE_GITHUB= yes GH_ACCOUNT= fluent USE_RC_SUBR= ${PORTNAME} CMAKE_ARGS= -DFLB_DEBUG=Off \ -DFLB_TRACE=Off LDFLAGS+= -lexecinfo OPTIONS_DEFINE= LUA_FILTER PGSQL SSL OPTIONS_DEFAULT= LUA_FILTER PGSQL SSL LUA_FILTER_DESC= Support for modifying incoming records using Lua scripts LUA_FILTER_USES= luajit:luajit pkgconfig LUA_FILTER_CMAKE_ON= -DFLB_FILTER_LUA=On \ -DFLB_LUAJIT=On \ -DFLB_PREFER_SYSTEM_LIB_LUAJIT=On LUA_FILTER_CMAKE_OFF= -DFLB_LUAJIT=Off PGSQL_USES= pgsql PGSQL_CMAKE_ON= -DFLB_OUT_PGSQL=On PGSQL_CMAKE_OFF= -DFLB_OUT_PGSQL=Off SSL_USES= ssl SSL_CMAKE_ON= -DFLB_TLS=On SSL_CMAKE_OFF= -DFLB_TLS=Off .include .if ${OPSYS} == FreeBSD CFLAGS+= -Wno-error=int-conversion .endif post-install: ${MV} ${STAGEDIR}${ETCDIR}/${PORTNAME}.conf ${STAGEDIR}${ETCDIR}/${PORTNAME}.conf.sample ${MV} ${STAGEDIR}${ETCDIR}/parsers.conf ${STAGEDIR}${ETCDIR}/parsers.conf.sample do-test-LUA_FILTER-on: ${STAGEDIR}${PREFIX}/bin/fluent-bit --help 2>/dev/null | grep -w -q lua .include diff --git a/sysutils/fluent-bit/files/fluent-bit.in b/sysutils/fluent-bit/files/fluent-bit.in index bbfa2d56efaa..d7c1979b3600 100644 --- a/sysutils/fluent-bit/files/fluent-bit.in +++ b/sysutils/fluent-bit/files/fluent-bit.in @@ -1,43 +1,50 @@ #!/bin/sh # PROVIDE: fluent-bit # REQUIRE: DAEMON # BEFORE: LOGIN # KEYWORD: shutdown # Add the following lines to /etc/rc.conf to enable fluent-bit: # # fluent_bit_enable (bool): Set to YES to enable fluent-bit # Default: NO # fluent_bit_config (str): config files to use # Default: %%ETCDIR%%/fluent-bit.conf # fluent_bit_flags (str): Extra flags passed to fluent-bit # fluent_bit_user (str): Default run as user nobody +# fluent_bit_group (str): Default run as group nogroup . /etc/rc.subr name="fluent_bit" rcvar=${name}_enable load_rc_config $name : ${fluent_bit_enable:="NO"} : ${fluent_bit_user:="nobody"} : ${fluent_bit_group:="nogroup"} : ${fluent_bit_config:="%%ETCDIR%%/fluent-bit.conf"} pidfile=/var/run/${name}.pid procname="%%PREFIX%%/bin/fluent-bit" command="/usr/sbin/daemon" -command_args="-H -p ${pidfile} -o /var/log/${name}/${name}.log ${procname} --quiet --config ${fluent_bit_config} ${fluent_bit_flags}" +command_args="-H -p ${pidfile} -o /var/log/${name}/${name}.log -t ${name} ${procname} --quiet --config ${fluent_bit_config} ${fluent_bit_flags}" -start_precmd=fluent_bit_startprecmd +start_precmd="${name}_startprecmd" +stop_postcmd="${name}_stoppostcmd" fluent_bit_startprecmd() { install -o ${fluent_bit_user} -g ${fluent_bit_group} -d /var/log/${name} if [ ! -e ${pidfile} ]; then - install -o ${fluent_bit_user} -g ${fluent_bit_group} /dev/null ${pidfile}; + install -m 0600 -o ${fluent_bit_user} -g ${fluent_bit_group} /dev/null ${pidfile} fi } +fluent_bit_stoppostcmd() +{ + rm -f ${pidfile} +} + run_rc_command "$1"