diff options
-rw-r--r-- | libpod/runtime.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go index ae4b77bd4..59264d0f5 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -540,6 +540,11 @@ func makeRuntime(runtime *Runtime) (err error) { lockPath = DefaultRootlessSHMLockPath } if doRefresh { + // If SHM locks already exist, delete them and reinitialize + if err := os.Remove(filepath.Join("/dev/shm", lockPath)); err != nil && !os.IsNotExist(err) { + return errors.Wrapf(err, "error deleting existing libpod SHM segment %s", lockPath) + } + manager, err = lock.NewSHMLockManager(lockPath, runtime.config.NumLocks) if err != nil { return errors.Wrapf(err, "error creating SHM locks for libpod") |