Good Morning,
I am trying to install Oracle DB 12c in a container.
Host: Ubuntu 18.04.1
Container: Guest Centos7
LXC Client version: 3.0.3
LXC Server version: 3.0.3
Oracle requires some parameters to be setup:
$lxc config set DB12C01Centos7 limits.kernel.nofile 1024:65536
$lxc config set DB12C01Centos7 limits.kernel.nproc 16384:16384
$lxc config set DB12C01Centos7 limits.kernel.stack 10240:32768
$lxc config set DB12C01Centos7 limits.kernel.memlock 31876710:31876710
I have setup the host /etc/security/limits.conf
soft nofile 1024
hard nofile 65536
soft nproc 16384
hard nproc 16384
soft stack 10240
hard stack 32768
soft memlock 31876710
hard memlock 31876710
$lxc config set DB12C01Centos7 limits.kernel.stack 10240:32768 setup prevents the container to start
$lxc start DB12C01Centos7
Error: Failed to run: /usr/lib/lxd/lxd forkstart DB12C01Centos7 /var/lib/lxd/containers /var/log/lxd/DB12C01Centos7/lxc.conf:
Try lxc info --show-log DB12C01Centos7 for more info
Did you track down exactly which one of the limits is the problem?
I suspect the issue may be that the LXD daemon itself may have lower ulimits applied to it, preventing the bump, but knowing what limit is the issue and at what value the issue starts would be useful.
I get the same error
$ lxc start DB12C01Centos7
Error: Failed to run: /usr/lib/lxd/lxd forkstart DB12C01Centos7 /var/lib/lxd/containers /var/log/lxd/DB12C01Centos7/lxc.conf:
Try lxc info --show-log DB12C01Centos7 for more info
Good evening
Any news?
It would be great, (if too complex to setup those parameters in the container) if LXC could inherit from host kernel parameters.
Thanks
We were both traveling for work in South Africa so were a bit busy that week, Christian is back home now and may have a bit more time to look into this.
I do not know where this parameter is stored in the kernel.
What I can say is:
The information is stored in
/etc/security/limits.conf or /etc/security/limits.d/limits.conf
under the format:
user soft stack 10240
user hard stack 32768
To activate those parameters
the /etc/pam.d/login needs to contain the following record
session required pam_limits.so
After to check whether the parameters have been properly updated:
$ulimit -Ss provides the soft stack: 10240
$ulimit -Hs provides the hard stack: 32768
Ah, I get it now. This is neither LXC’s nor LXD’s fault. You specify limits.kernel.stack under the assumption that this is specified in kib when it is actually specified in bytes. So you end up with a way to small stack and so LXC and any program started in there get SIGSEVed by the kernel because their crossing stack boundaries. What you want is to kib to bytes: