diff options
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r-- | libpod/runtime.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go index e8442f4a1..ca10f9243 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -318,6 +318,7 @@ func defaultRuntimeConfig() (RuntimeConfig, error) { NumLocks: 2048, EventsLogger: events.DefaultEventerType.String(), DetachKeys: DefaultDetachKeys, + LockType: "shm", }, nil } @@ -664,6 +665,20 @@ func getLockManager(runtime *Runtime) (lock.Manager, error) { var manager lock.Manager switch runtime.config.LockType { + case "file": + lockPath := filepath.Join(runtime.config.TmpDir, "locks") + manager, err = lock.OpenFileLockManager(lockPath) + if err != nil { + if os.IsNotExist(errors.Cause(err)) { + manager, err = lock.NewFileLockManager(lockPath) + if err != nil { + return nil, errors.Wrapf(err, "failed to get new file lock manager") + } + } else { + return nil, err + } + } + case "", "shm": lockPath := DefaultSHMLockPath if rootless.IsRootless() { |