ulimit in test kitchen

248 views Asked by At

The operating system is Centos 7, I am using Test Kitchen 1.13.2 and centos-7.2 default vagrant box.

I need nproc to be above a certain limit for one user, for this I modified /etc/security/limits.d/20-nproc.conf (Which overrides /etc/security/limits.conf) and added

myuser    soft    nproc    99999

However, after rebooting the VM created by kitchen and I log via kitchen login and run ulimit -a I see this:

core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 1878
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 1878
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

I am afraid there is something in the way Kitchen connects to the VMs it generates that does not load limits.conf configuration. Any idea how to be able to test this locally on Kitchen?

1

There are 1 answers

4
Szymon On

When you login using kitchen login default user is vagrant, if you want to check limits for user myuser, run:

  1. sudo su -
  2. su -l myuser
  3. ulimit -a

It works for me ;-)