diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-09-06 12:43:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-06 12:43:55 +0200 |
commit | 6b3bb9e75e239f4470bca843f0a2cdf5b5e9b82c (patch) | |
tree | c3504335e6f65b5262a24c88a7dac0da978ae531 /libpod/runtime_ctr.go | |
parent | a61a9525e37f6a3a76e8e12b61dac5131700e9d1 (diff) | |
parent | a3aecf0f26971cbf178fc705d0983ee248a6492b (diff) | |
download | podman-6b3bb9e75e239f4470bca843f0a2cdf5b5e9b82c.tar.gz podman-6b3bb9e75e239f4470bca843f0a2cdf5b5e9b82c.tar.bz2 podman-6b3bb9e75e239f4470bca843f0a2cdf5b5e9b82c.zip |
Merge pull request #15632 from dfr/freebsd-container
Add support for FreeBSD containers
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r-- | libpod/runtime_ctr.go | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index b43114fab..1e1b7dad5 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -171,12 +171,17 @@ func (r *Runtime) initContainerVariables(rSpec *spec.Spec, config *ContainerConf if config == nil { ctr.config.ID = stringid.GenerateNonCryptoID() size, err := units.FromHumanSize(r.config.Containers.ShmSize) - if err != nil { - return nil, fmt.Errorf("converting containers.conf ShmSize %s to an int: %w", r.config.Containers.ShmSize, err) + if useDevShm { + if err != nil { + return nil, fmt.Errorf("converting containers.conf ShmSize %s to an int: %w", r.config.Containers.ShmSize, err) + } + ctr.config.ShmSize = size + ctr.config.NoShm = false + ctr.config.NoShmShare = false + } else { + ctr.config.NoShm = true + ctr.config.NoShmShare = true } - ctr.config.ShmSize = size - ctr.config.NoShm = false - ctr.config.NoShmShare = false ctr.config.StopSignal = 15 ctr.config.StopTimeout = r.config.Engine.StopTimeout @@ -528,7 +533,7 @@ func (r *Runtime) setupContainer(ctx context.Context, ctr *Container) (_ *Contai } } - if !MountExists(ctr.config.Spec.Mounts, "/dev/shm") && ctr.config.ShmDir == "" && !ctr.config.NoShm { + if useDevShm && !MountExists(ctr.config.Spec.Mounts, "/dev/shm") && ctr.config.ShmDir == "" && !ctr.config.NoShm { ctr.config.ShmDir = filepath.Join(ctr.bundlePath(), "shm") if err := os.MkdirAll(ctr.config.ShmDir, 0700); err != nil { if !os.IsExist(err) { |