From ddee5f27f383ad517b88bc707ffff94efc662161 Mon Sep 17 00:00:00 2001 From: David Scott Date: Fri, 20 Jul 2018 15:31:29 +0100 Subject: [PATCH 1/2] memlogd/logwrite: use the same naming convention as init In e8786d73bb5665b4d548781949e318af6967be03 the logwrite package will automatically append .log to every log. In 5201049f2ccb92d3933ab39f1a1a498c09dda669 the init package will send stderr of a service `s` to a log named `s` and the stdout to `s.out`. Therefore the files we create on disk are `s.log` and `s.out.log`. This patch modifies the memlogd `logwrite` command-line wrapper to use the same convention. Note there is a confusing name clash between `pkg/logwrite` and `cmd/logwrite` in `memlogd` modified here. Signed-off-by: David Scott --- pkg/memlogd/cmd/logwrite/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/memlogd/cmd/logwrite/main.go b/pkg/memlogd/cmd/logwrite/main.go index 707547237..eb99b93d4 100644 --- a/pkg/memlogd/cmd/logwrite/main.go +++ b/pkg/memlogd/cmd/logwrite/main.go @@ -70,11 +70,11 @@ func main() { raddr := net.UnixAddr{Name: serverSocket, Net: "unixgram"} - if err = sendFD(conn, &raddr, name+".stdout", remoteStdoutFd); err != nil { + if err = sendFD(conn, &raddr, name+".out", remoteStdoutFd); err != nil { log.Fatal("fd stdout send failed: ", err) } - if err = sendFD(conn, &raddr, name+".stderr", remoteStderrFd); err != nil { + if err = sendFD(conn, &raddr, name, remoteStderrFd); err != nil { log.Fatal("fd stderr send failed: ", err) } From d6e7fb9549a1a4b5e32bc440f7b5b4202b5061ba Mon Sep 17 00:00:00 2001 From: David Scott Date: Fri, 20 Jul 2018 17:06:13 +0100 Subject: [PATCH 2/2] Update yaml to linuxkit/memlogd:ba4fcf55c35a3833546a1e39125bf0fa940327b0 Signed-off-by: David Scott --- examples/logging.yml | 2 +- test/cases/040_packages/030_logwrite/test.yml | 2 +- test/cases/040_packages/031_kmsg/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/logging.yml b/examples/logging.yml index fb1b74734..2ae22d705 100644 --- a/examples/logging.yml +++ b/examples/logging.yml @@ -7,7 +7,7 @@ init: - linuxkit/runc:v0.5 - linuxkit/containerd:0784cc754edb296b996c3510abbdf69686ef0f24 - linuxkit/ca-certificates:v0.5 - - linuxkit/memlogd:v0.5 + - linuxkit/memlogd:ba4fcf55c35a3833546a1e39125bf0fa940327b0 onboot: - name: sysctl image: linuxkit/sysctl:v0.5 diff --git a/test/cases/040_packages/030_logwrite/test.yml b/test/cases/040_packages/030_logwrite/test.yml index 1f30dbfe0..160cb319b 100644 --- a/test/cases/040_packages/030_logwrite/test.yml +++ b/test/cases/040_packages/030_logwrite/test.yml @@ -6,7 +6,7 @@ init: - linuxkit/runc:v0.5 - linuxkit/containerd:0784cc754edb296b996c3510abbdf69686ef0f24 - linuxkit/ca-certificates:v0.5 - - linuxkit/memlogd:v0.5 + - linuxkit/memlogd:ba4fcf55c35a3833546a1e39125bf0fa940327b0 services: # A service which generates logs of log messages - name: fill-the-logs diff --git a/test/cases/040_packages/031_kmsg/test.yml b/test/cases/040_packages/031_kmsg/test.yml index 8f88993b2..89453f1ba 100644 --- a/test/cases/040_packages/031_kmsg/test.yml +++ b/test/cases/040_packages/031_kmsg/test.yml @@ -6,7 +6,7 @@ init: - linuxkit/runc:v0.5 - linuxkit/containerd:0784cc754edb296b996c3510abbdf69686ef0f24 - linuxkit/ca-certificates:v0.5 - - linuxkit/memlogd:v0.5 + - linuxkit/memlogd:ba4fcf55c35a3833546a1e39125bf0fa940327b0 services: - name: kmsg image: linuxkit/kmsg:cf3dc833591838596427aac032c829ea592599d0