From owner-dev-commits-ports-all@freebsd.org Thu Sep 2 22:37:27 2021 Return-Path: Delivered-To: dev-commits-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31079668ED8; Thu, 2 Sep 2021 22:37:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H0wm70tgHz4g7L; Thu, 2 Sep 2021 22:37:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0676720FD9; Thu, 2 Sep 2021 22:37:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 182MbQNa004575; Thu, 2 Sep 2021 22:37:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 182MbQua004574; Thu, 2 Sep 2021 22:37:26 GMT (envelope-from git) Date: Thu, 2 Sep 2021 22:37:26 GMT Message-Id: <202109022237.182MbQua004574@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Palle Girgensohn Subject: git: 2b5d5148c0f3 - main - sysutils/fluent-bit: fix problems running the fluent-bit MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: girgen X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2b5d5148c0f32f81380555f1ade6269cd04ce716 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Sep 2021 22:37:27 -0000 The branch main has been updated by girgen: URL: https://cgit.FreeBSD.org/ports/commit/?id=2b5d5148c0f32f81380555f1ade6269cd04ce716 commit 2b5d5148c0f32f81380555f1ade6269cd04ce716 Author: Palle Girgensohn AuthorDate: 2021-09-02 22:27:32 +0000 Commit: Palle Girgensohn CommitDate: 2021-09-02 22:37:18 +0000 sysutils/fluent-bit: fix problems running the fluent-bit There is a known problem with the default coro_stack_size being too small. Double it to avoid failing to start. [1] Since the daemon option seems to be somewhat funky [2], use daemon to wrap the fluent-bit binary when running from the rc.d script. [1] https://github.com/fluent/fluent-bit/issues/3716 PR: 255593 [2] --- sysutils/fluent-bit/Makefile | 1 + sysutils/fluent-bit/files/fluent-bit.in | 20 +++++++++++++++++--- .../fluent-bit/files/patch-conf__fluent-bit.conf | 20 ++++++++++++++++++++ .../files/patch-include__fluent-bit__flb_coro.h | 11 +++++++++++ 4 files changed, 49 insertions(+), 3 deletions(-) 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 @@ -3,6 +3,7 @@ PORTNAME= fluent-bit DISTVERSIONPREFIX= v DISTVERSION= 1.8.6 +PORTREVISION= 1 CATEGORIES= sysutils MAINTAINER= girgen@FreeBSD.org 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 @@ -12,7 +12,7 @@ # 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 @@ -22,8 +22,22 @@ 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))