-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fluent Bit is a super fast, lightweight, and highly scalable logging and metrics processor and forwarder. Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com> [Peter: add DEVELOPERS entry, drop STATIC_LIBS dependency] Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
- Loading branch information
1 parent
c373ca0
commit 6a0f7c3
Showing
6 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
config BR2_PACKAGE_FLUENT_BIT | ||
bool "fluent-bit" | ||
depends on BR2_TOOLCHAIN_USES_GLIBC | ||
select BR2_PACKAGE_OPENSSL | ||
select BR2_PACKAGE_LIBYAML | ||
help | ||
Fast and Lightweight Logs and Metrics processor. | ||
|
||
https://github.com/fluent/fluent-bit | ||
|
||
comment "fluent-bit needs a glibc toolchain" | ||
depends on !BR2_TOOLCHAIN_USES_GLIBC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/sh | ||
|
||
DAEMON="fluent-bit" | ||
PID_FILE="/var/run/$DAEMON.pid" | ||
CONF_FILE="/etc/$DAEMON/$DAEMON.conf" | ||
|
||
FLUENT_BIT_ARGS="" | ||
|
||
# shellcheck source=/dev/null | ||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON" | ||
|
||
start() { | ||
printf 'Starting %s: ' "$DAEMON" | ||
# shellcheck disable=SC2086 # we need the word splitting | ||
start-stop-daemon -S -q -b -m -p "$PID_FILE" --exec "/usr/bin/$DAEMON" \ | ||
-- -c "$CONF_FILE" $FLUENT_BIT_ARGS | ||
status=$? | ||
if [ "$status" -eq 0 ]; then | ||
echo "OK" | ||
else | ||
echo "FAIL" | ||
fi | ||
return "$status" | ||
} | ||
|
||
stop() { | ||
printf 'Stopping %s: ' "$DAEMON" | ||
start-stop-daemon -K -q -p "$PID_FILE" | ||
status=$? | ||
|
||
if [ -f "$PID_FILE" ]; then | ||
pid=$(cat "$PID_FILE") | ||
rm -f "$PID_FILE" | ||
|
||
# https://docs.fluentbit.io/manual/administration/configuring-fluent-bit/yaml/configuration-file#config_section | ||
# The default grace time is set to 5 seconds, so use 6 seconds to have some margin. | ||
timeout=6 | ||
while kill -0 "$pid" 2>/dev/null; do | ||
[ $timeout -eq 0 ] && status=1 && break | ||
timeout=$((timeout - 1)) | ||
sleep 1 | ||
done | ||
fi | ||
|
||
if [ "$status" -eq 0 ]; then | ||
echo "OK" | ||
else | ||
echo "FAIL" | ||
fi | ||
return "$status" | ||
} | ||
|
||
restart() { | ||
stop | ||
start | ||
} | ||
|
||
case "$1" in | ||
start) | ||
start | ||
;; | ||
stop) | ||
stop | ||
;; | ||
restart | reload) | ||
restart | ||
;; | ||
*) | ||
echo "Usage: $0 {start|stop|restart}" | ||
exit 1 | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Locally computed | ||
sha256 8ff5566389033669feabc9c69a5c6f417dad5c8b066454388e6a706507262acf fluent-bit-2.0.8.tar.gz | ||
sha256 0d542e0c8804e39aa7f37eb00da5a762149dc682d7829451287e11b938e94594 LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
################################################################################ | ||
# | ||
# fluent-bit | ||
# | ||
################################################################################ | ||
|
||
FLUENT_BIT_VERSION = 2.0.8 | ||
FLUENT_BIT_SITE = $(call github,fluent,fluent-bit,v$(FLUENT_BIT_VERSION)) | ||
FLUENT_BIT_LICENSE = Apache-2.0 | ||
FLUENT_BIT_LICENSE_FILES = LICENSE | ||
FLUENT_BIT_DEPENDENCIES = host-bison host-flex libyaml libopenssl | ||
|
||
FLUENT_BIT_CONF_OPTS += \ | ||
-DFLB_DEBUG=No \ | ||
-DFLB_RELEASE=Yes \ | ||
-DFLB_EXAMPLES=No \ | ||
-DFLB_CHUNK_TRACE=No \ | ||
-DFLB_BACKTRACE=No | ||
|
||
ifeq ($(BR2_PACKAGE_LUAJIT),y) | ||
FLUENT_BIT_CONF_OPTS += -DFLB_LUAJIT=Yes | ||
FLUENT_BIT_DEPENDENCIES += luajit | ||
else | ||
FLUENT_BIT_CONF_OPTS += -DFLB_LUAJIT=No | ||
endif | ||
|
||
# Force bundled miniz to be linked statically. | ||
# https://github.com/fluent/fluent-bit/issues/6711 | ||
FLUENT_BIT_CONF_OPTS += \ | ||
-DBUILD_SHARED_LIBS=OFF | ||
|
||
# Move the config files from /usr/etc/ to /etc/. | ||
# https://github.com/fluent/fluent-bit/issues/6619 | ||
FLUENT_BIT_CONF_OPTS += \ | ||
-DCMAKE_INSTALL_SYSCONFDIR="/etc/" | ||
|
||
# Undefining _FILE_OFFSET_BITS here because of a "bug" with glibc fts.h | ||
# large file support. | ||
# See https://bugzilla.redhat.com/show_bug.cgi?id=574992 for more information. | ||
FLUENT_BIT_CONF_OPTS += \ | ||
-DCMAKE_C_FLAGS="$(TARGET_CFLAGS) -U_FILE_OFFSET_BITS" \ | ||
-DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -U_FILE_OFFSET_BITS" | ||
|
||
define FLUENT_BIT_INSTALL_INIT_SYSV | ||
$(INSTALL) -D -m 0755 package/fluent-bit/S99fluent-bit \ | ||
$(TARGET_DIR)/etc/init.d/S99fluent-bit | ||
endef | ||
|
||
$(eval $(cmake-package)) |