From 1d88da4acbf721ab319261e84ac27985a5812770 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sat, 15 Jul 2023 14:53:27 +0700 Subject: all: patch the default config.yaml to use systemd_journald Previosly, the default config.yaml receivers for syslog is using "type: files" that read /var/log/messages and /var/log/syslog. In Arch Linux, those files are not exist anymore, so we replace the with "type: systemd_journald" to make all the system logs forwarded to Cloud Logging. --- .SRCINFO | 2 +- 0001-build-sh.patch | 22 ++++++++++++++++------ PKGBUILD | 4 ++-- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index 8a72a1d..a2eb0e5 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -26,6 +26,6 @@ pkgbase = google-cloud-ops-agent-git sha256sums = SKIP sha256sums = SKIP sha256sums = SKIP - sha256sums = a4ec5040542b3b7b33b995f8357fd81dac901975f7d52955b713f8cccc756501 + sha256sums = b76f3853c695b688d1c34ba967b04c9d3eca58e7cd20af45a1403789e3481525 pkgname = google-cloud-ops-agent-git diff --git a/0001-build-sh.patch b/0001-build-sh.patch index 4461f55..29b9210 100644 --- a/0001-build-sh.patch +++ b/0001-build-sh.patch @@ -27,9 +27,19 @@ index 4a97050f7..041b3ac72 100755 - # N.B. Don't include $DESTDIR itself in the tarball, since mktemp -d will create it mode 0700. (cd "$DESTDIR" && tar -czf /tmp/google-cloud-ops-agent.tgz *) -diff --git a/submodules/fluent-bit b/submodules/fluent-bit ---- a/submodules/fluent-bit -+++ b/submodules/fluent-bit -@@ -1 +1 @@ --Subproject commit 97a5e9dcf3f9d2e2107660cf73f6ef253fd227cd -+Subproject commit 97a5e9dcf3f9d2e2107660cf73f6ef253fd227cd-dirty +diff --git a/confgenerator/built-in-config-linux.yaml b/confgenerator/built-in-config-linux.yaml +index cd84fc39b..10eb9c2fe 100644 +--- a/confgenerator/built-in-config-linux.yaml ++++ b/confgenerator/built-in-config-linux.yaml +@@ -1,10 +1,7 @@ + logging: + receivers: + syslog: +- type: files +- include_paths: +- - /var/log/messages +- - /var/log/syslog ++ type: systemd_journald + service: + pipelines: + default_pipeline: diff --git a/PKGBUILD b/PKGBUILD index ede92d9..35fd5b4 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -42,7 +42,7 @@ sha256sums=( 'SKIP' 'SKIP' 'SKIP' - 'a4ec5040542b3b7b33b995f8357fd81dac901975f7d52955b713f8cccc756501' + 'b76f3853c695b688d1c34ba967b04c9d3eca58e7cd20af45a1403789e3481525' ) pkgver() { @@ -70,6 +70,7 @@ build() { echo "destdir: $_destdir" cd "${pkgname}" + git apply "${srcdir}/0001-build-sh.patch" CGO_ENABLED=1 ./builds/otel.sh "$_destdir" ./builds/fluent_bit.sh "$_destdir" @@ -77,7 +78,6 @@ build() { ./builds/ops_agent_diagnostics.sh "$_destdir" ./builds/agent_wrapper.sh "$_destdir" - git apply "${srcdir}/0001-build-sh.patch" BUILD_DISTRO=arch CODE_VERSION="${pkgver}" DESTDIR="$_destdir" \ ./build.sh } -- cgit v1.3