From e908e1a357b435d7fab497d51cdd3e58458a0590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20B=C3=BCcker?= Date: Thu, 8 Jun 2017 10:05:52 +0200 Subject: [PATCH] Logging driver should receive same file in start/stop request MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Peter Bücker --- daemon/logger/adapter.go | 4 +++- daemon/logger/plugin.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/daemon/logger/adapter.go b/daemon/logger/adapter.go index e6d7598b4480e..a187b30fdd258 100644 --- a/daemon/logger/adapter.go +++ b/daemon/logger/adapter.go @@ -3,6 +3,7 @@ package logger import ( "io" "os" + "strings" "sync" "time" @@ -18,6 +19,7 @@ type pluginAdapter struct { driverName string id string plugin logPlugin + basePath string fifoPath string capabilities Capability logInfo Info @@ -56,7 +58,7 @@ func (a *pluginAdapter) Close() error { a.mu.Lock() defer a.mu.Unlock() - if err := a.plugin.StopLogging(a.fifoPath); err != nil { + if err := a.plugin.StopLogging(strings.TrimPrefix(a.fifoPath, a.basePath)); err != nil { return err } diff --git a/daemon/logger/plugin.go b/daemon/logger/plugin.go index de618c5aea81c..bdccea5b21b51 100644 --- a/daemon/logger/plugin.go +++ b/daemon/logger/plugin.go @@ -59,6 +59,7 @@ func makePluginCreator(name string, l *logPluginProxy, basePath string) Creator driverName: name, id: id, plugin: l, + basePath: basePath, fifoPath: filepath.Join(root, id), logInfo: logCtx, }