0

I have changed /etc/security/limits.com and rebooted the machine remotely, However, after the boot, the nproc parameter has still the old value.

[ost@compute-0-1 ~]$ cat /etc/security/limits.conf
*   -   memlock     -1
*   -   stack       -1
*   -   nofile      4096
*   -   nproc       4096        <=====================================
[ost@compute-0-1 ~]$
Broadcast message from root@compute-0-1.local
    (/dev/pts/0) at 19:27 ...

The system is going down for reboot NOW!
Connection to compute-0-1 closed by remote host.
Connection to compute-0-1 closed.
ost@cluster:~$ ssh compute-0-1
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Last login: Tue Sep 27 19:25:25 2016 from cluster.local
Rocks Compute Node
Rocks 6.1 (Emerald Boa)
Profile built 19:00 23-Aug-2016

Kickstarted 19:08 23-Aug-2016
[ost@compute-0-1 ~]$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 516294
max locked memory       (kbytes, -l) unlimited
max memory size         (kbytes, -m) unlimited
open files                      (-n) 4096
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) unlimited
cpu time               (seconds, -t) unlimited
max user processes              (-u) 1024     <=========================
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

Please see that I set max user processes to 4096 but after the reboot, the value is still 1024.

4

1 回答 1

1

请查看一个名为/etc/pam.d/sshd. 如果可以找到它,请打开文件并插入以下行。

session    required   pam_limits.so

这样新值即使在重新启动后也将生效。

PAM 是一个与认证相关的模块。所以需要通过ssh登录来启用模块。

更多详情man pam_limits

谢谢!

于 2016-09-27T17:01:24.293 回答