diff options
author | Paul Holzinger <pholzing@redhat.com> | 2022-09-12 11:15:35 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2022-09-12 18:05:18 +0200 |
commit | b3212a6802b9a9dd5311dcbebe68c9c67fd96218 (patch) | |
tree | 64bde13ff9ab31a36a7ed3fce727a34ea31cf8c3 /libpod/events.go | |
parent | 12a1483e7fdf3d1d1526f3631dc4ad2cbe1bcd37 (diff) | |
download | podman-b3212a6802b9a9dd5311dcbebe68c9c67fd96218.tar.gz podman-b3212a6802b9a9dd5311dcbebe68c9c67fd96218.tar.bz2 podman-b3212a6802b9a9dd5311dcbebe68c9c67fd96218.zip |
set default EventsLogFilePath on first run
The current code only sets EventsLogFilePath when the tmp is overwritten
from the db. We should always set the default when no path was set in
containers.conf.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'libpod/events.go')
-rw-r--r-- | libpod/events.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libpod/events.go b/libpod/events.go index ad9c5eafe..2f9799114 100644 --- a/libpod/events.go +++ b/libpod/events.go @@ -3,6 +3,7 @@ package libpod import ( "context" "fmt" + "path/filepath" "sync" "github.com/containers/podman/v4/libpod/events" @@ -11,6 +12,10 @@ import ( // newEventer returns an eventer that can be used to read/write events func (r *Runtime) newEventer() (events.Eventer, error) { + if r.config.Engine.EventsLogFilePath == "" { + // default, use path under tmpdir when none was explicitly set by the user + r.config.Engine.EventsLogFilePath = filepath.Join(r.config.Engine.TmpDir, "events", "events.log") + } options := events.EventerOptions{ EventerType: r.config.Engine.EventsLogger, LogFilePath: r.config.Engine.EventsLogFilePath, |