From e7e623fc461b34b52265456674deff5bafd26c3c 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 #2 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. # Conflicts: # .SRCINFO # PKGBUILD --- .SRCINFO | 2 +- 0001-build-sh.patch | 16 ++++++++++++++++ PKGBUILD | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index a2eb0e5..6697a83 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -26,6 +26,6 @@ pkgbase = google-cloud-ops-agent-git sha256sums = SKIP sha256sums = SKIP sha256sums = SKIP - sha256sums = b76f3853c695b688d1c34ba967b04c9d3eca58e7cd20af45a1403789e3481525 + sha256sums = ba66d01b8058644597d9b406d3b8ce7ed40aed77c7358f2b97ff0e262a4cbb98 pkgname = google-cloud-ops-agent-git diff --git a/0001-build-sh.patch b/0001-build-sh.patch index 29b9210..0c77457 100644 --- a/0001-build-sh.patch +++ b/0001-build-sh.patch @@ -1,3 +1,19 @@ +diff --git a/apps/builtinconf.go b/apps/builtinconf.go +index 361f2f206..597ecc36f 100644 +--- a/apps/builtinconf.go ++++ b/apps/builtinconf.go +@@ -21,9 +21,8 @@ var ( + "linux": { + Logging: &cg.Logging{ + Receivers: map[string]cg.LoggingReceiver{ +- "syslog": &cg.LoggingReceiverFiles{ +- ConfigComponent: cg.ConfigComponent{Type: "files"}, +- IncludePaths: []string{"/var/log/messages", "/var/log/syslog"}, ++ "syslog": &cg.LoggingReceiverSystemd{ ++ ConfigComponent: cg.ConfigComponent{Type: "systemd_journald"}, + }, + }, + Processors: map[string]cg.LoggingProcessor{}, diff --git a/build.sh b/build.sh index 4a97050f7..041b3ac72 100755 --- a/build.sh diff --git a/PKGBUILD b/PKGBUILD index 35fd5b4..1895934 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -42,7 +42,7 @@ sha256sums=( 'SKIP' 'SKIP' 'SKIP' - 'b76f3853c695b688d1c34ba967b04c9d3eca58e7cd20af45a1403789e3481525' + 'ba66d01b8058644597d9b406d3b8ce7ed40aed77c7358f2b97ff0e262a4cbb98' ) pkgver() { -- cgit v1.3