2016-09-27 60 views
0

我已更改/etc/security/limits.com並遠程重新啓動計算機,但啓動後nproc參數仍爲舊值。重新啓動後ulimit chnage無效

[[email protected] ~]$ cat /etc/security/limits.conf 
* - memlock  -1 
* - stack  -1 
* - nofile  4096 
* - nproc  4096  <===================================== 
[[email protected] ~]$ 
Broadcast message from [email protected] 
    (/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. 
[email protected]:~$ 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 
[[email protected] ~]$ 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 

請看到我設置max user processes 4096,但在重新啓動後,該值仍是1024

回答

1

請看看一個名爲/etc/pam.d/sshd文件。 如果您可以找到它,請打開該文件並插入以下行。

session required pam_limits.so 

然後即使重新啓動後新值也會生效。

PAM是一個與認證有關的模塊。所以你需要通過ssh登錄啓用模塊。

有關man pam_limits的更多詳細信息。

謝謝!

+0

這會影響計算節點或服務器嗎?我的意思是我應該在服務器上還是在每個計算節點上編輯該文件? – mahmood

+0

嗨mahmood,這是一個服務器上的設置。你不必在每個節點上都這麼做。 – ntakashi