diff --git a/sysutils/fluent-bit/Makefile b/sysutils/fluent-bit/Makefile index 28943856fbfc..fa6846741898 100644 --- a/sysutils/fluent-bit/Makefile +++ b/sysutils/fluent-bit/Makefile @@ -1,59 +1,60 @@ # Created by: Palle Girgensohn PORTNAME= fluent-bit DISTVERSIONPREFIX= v DISTVERSION= 1.8.6 +PORTREVISION= 1 CATEGORIES= sysutils MAINTAINER= girgen@FreeBSD.org COMMENT= Fast and lightweight data forwarder LICENSE= APACHE20 BROKEN_mips= fails to build: conflicting types for 'restrict' BROKEN_mips64= fails to build: conflicting types for 'restrict' BROKEN_riscv64= fails to build: No support for this architecture (yet) USE_GITHUB= yes GH_ACCOUNT= fluent USES= cmake:noninja gmake bison OPTIONS_DEFINE= SSL PGSQL OPTIONS_DEFAULT= SSL LDFLAGS= -lexecinfo CMAKE_ARGS= -DFLB_DEBUG=Off -DFLB_TRACE=Off SSL_USES= ssl SSL_CMAKE_ON= -DFLB_TLS=On SSL_CMAKE_OFF= -DFLB_TLS=Off EXAMPLES_CMAKE_ON= -DFLB_EXAMPLES=On EXAMPLES_CMAKE_OFF= -DFLB_EXAMPLES=Off PGSQL_USES= pgsql PGSQL_CMAKE_ON= -DFLB_OUT_PGSQL=On PGSQL_CMAKE_OFF= -DFLB_OUT_PGSQL=Off USE_RC_SUBR= ${PORTNAME} .include .if ${OPSYS} == FreeBSD && ${OSVERSION} < 1200000 EXTRA_PATCHES= ${PATCHDIR}/extra-patch-lib_luajit__src__lj_prng.c .endif .if ${ARCH:Mpowerpc64*} CMAKE_ARGS+= -DFLB_LUAJIT:BOOL=OFF .elif ${ARCH} == powerpc USES+= compiler:gcc-c++11-lib .else USES+= compiler:c11 .endif post-install: ${MV} ${STAGEDIR}${ETCDIR}/${PORTNAME}.conf ${STAGEDIR}${ETCDIR}/${PORTNAME}.conf.sample ${MV} ${STAGEDIR}${ETCDIR}/parsers.conf ${STAGEDIR}${ETCDIR}/parsers.conf.sample .include diff --git a/sysutils/fluent-bit/files/fluent-bit.in b/sysutils/fluent-bit/files/fluent-bit.in index 85ae67e7aee6..10ecfef930cb 100644 --- a/sysutils/fluent-bit/files/fluent-bit.in +++ b/sysutils/fluent-bit/files/fluent-bit.in @@ -1,29 +1,43 @@ #!/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_user (str): Default run as user nobody . /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"} -command=%%PREFIX%%/bin/fluent-bit -command_args="--quiet --daemon --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} --daemon" + +start_precmd=fluent_bit_startprecmd + +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}; + fi +} run_rc_command "$1" diff --git a/sysutils/fluent-bit/files/patch-conf__fluent-bit.conf b/sysutils/fluent-bit/files/patch-conf__fluent-bit.conf new file mode 100644 index 000000000000..a373dcab8cc6 --- /dev/null +++ b/sysutils/fluent-bit/files/patch-conf__fluent-bit.conf @@ -0,0 +1,20 @@ +--- conf/fluent-bit.conf.orig 2021-09-02 23:28:51.035454000 +0200 ++++ conf/fluent-bit.conf 2021-09-02 23:38:09.521171000 +0200 +@@ -81,12 +81,13 @@ + # + # storage.backlog.mem_limit 5M + +-[INPUT] +- name cpu +- tag cpu.local ++#[INPUT] ++ # fails on FreeBSD for some reason, propably not supported ++ # name cpu ++ # tag cpu.local + + # Read interval (sec) Default: 1 +- interval_sec 1 ++ # interval_sec 1 + + [OUTPUT] + name stdout diff --git a/sysutils/fluent-bit/files/patch-include__fluent-bit__flb_coro.h b/sysutils/fluent-bit/files/patch-include__fluent-bit__flb_coro.h new file mode 100644 index 000000000000..7d0b2f0548fc --- /dev/null +++ b/sysutils/fluent-bit/files/patch-include__fluent-bit__flb_coro.h @@ -0,0 +1,11 @@ +--- include/fluent-bit/flb_coro.h.orig 2021-09-02 23:11:40.144014000 +0200 ++++ include/fluent-bit/flb_coro.h 2021-09-02 23:12:34.983243000 +0200 +@@ -65,7 +65,7 @@ + #ifdef FLB_CORO_STACK_SIZE + #define FLB_CORO_STACK_SIZE FLB_CORO_STACK_SIZE + #else +-#define FLB_CORO_STACK_SIZE ((3 * PTHREAD_STACK_MIN) / 2) ++#define FLB_CORO_STACK_SIZE ((6 * PTHREAD_STACK_MIN) / 2) + #endif + + #define FLB_CORO_DATA(coro) (((char *) coro) + sizeof(struct flb_coro))