summaryrefslogtreecommitdiff
path: root/pkg/spec
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-08-27 14:14:09 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-28 17:32:24 +0000
commit9da94c454fc6d1e2e6ce41f0bc177b9711ccc66b (patch)
tree17fda0a5186bce979dee0e1876b78e3fff314fdd /pkg/spec
parent822c327997213f36f19936e54923b7c2776248b0 (diff)
downloadpodman-9da94c454fc6d1e2e6ce41f0bc177b9711ccc66b.tar.gz
podman-9da94c454fc6d1e2e6ce41f0bc177b9711ccc66b.tar.bz2
podman-9da94c454fc6d1e2e6ce41f0bc177b9711ccc66b.zip
Set default max open files in spec
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #1355 Approved by: rhatdan
Diffstat (limited to 'pkg/spec')
-rw-r--r--pkg/spec/spec.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/spec/spec.go b/pkg/spec/spec.go
index a915c305f..a2fa169e5 100644
--- a/pkg/spec/spec.go
+++ b/pkg/spec/spec.go
@@ -444,13 +444,24 @@ func addRlimits(config *CreateConfig, g *generate.Generator) error {
err error
)
+ nofileSet := false
+
for _, u := range config.Resources.Ulimit {
if ul, err = units.ParseUlimit(u); err != nil {
return errors.Wrapf(err, "ulimit option %q requires name=SOFT:HARD, failed to be parsed", u)
}
+ if ul.Name == "nofile" {
+ nofileSet = true
+ }
+
g.AddProcessRlimits("RLIMIT_"+strings.ToUpper(ul.Name), uint64(ul.Hard), uint64(ul.Soft))
}
+
+ if !nofileSet {
+ g.AddProcessRlimits("RLIMIT_NOFILE", 1048576, 1048576)
+ }
+
return nil
}