重启后 ulimit 更改无效
Ulimit chnage after reboot as no effect
我已经更改了/etc/security/limits.com
并远程重启了机器,但是,开机后,nproc
参数仍然是旧值。
[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
请看我把max user processes
设置为4096,但是重启后还是1024。
请查看名为 /etc/pam.d/sshd
的文件。
如果可以找到它,请打开文件并插入以下行。
session required pam_limits.so
那么重启后新值也会生效
PAM是一个与认证相关的模块。所以你需要通过ssh登录来启用该模块。
有关 man pam_limits
的更多详细信息。
谢谢!
我已经更改了/etc/security/limits.com
并远程重启了机器,但是,开机后,nproc
参数仍然是旧值。
[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
请看我把max user processes
设置为4096,但是重启后还是1024。
请查看名为 /etc/pam.d/sshd
的文件。
如果可以找到它,请打开文件并插入以下行。
session required pam_limits.so
那么重启后新值也会生效
PAM是一个与认证相关的模块。所以你需要通过ssh登录来启用该模块。
有关 man pam_limits
的更多详细信息。
谢谢!