tid=59112& 本帖最後由 IT_man 於 2017-3-28 10:13 編輯 7 M6 B% Z3 }, k+ t+ M/ |9 K
! ]- ` J- P& }+ L
徵狀:, G% N3 {) |( _, I/ B+ T
3 z7 C% A7 G+ `5 l3 q9 ^
某天因為需要從root su 到一般的user,指令如下:
v! ]3 w1 _3 b- |3 | C( a#su someuser 結果show error+ _# l4 @- `4 F8 M8 m0 [
su: cannot set user id: Resource temporarily unavailable
+ R" D% f- l# ^9 u! h
$ J1 l! C" ~9 M查了google得知根本原因是process 最大限制是 1024:
0 H. d6 T8 `; w# n: y1 h) Q
5 F+ z# h5 C: g/ t- v' V% D#cat /etc/security/limits.d/90-nproc.conf
- l7 b! Q7 V5 x0 j6 x+ f# Default limit for number of user's processes to prevent2 Z; y" Q4 r6 `
# accidental fork bombs.' `% L" n/ h" A; Z2 y
# See rhbz #432903 for reasoning.1 \! a+ u, t# x) P' e6 a
8 k; f7 ^4 H4 m8 b, h; ]5 Y: E* soft nproc 1024 ====>將1024改成大一點如4096就 OK* w5 a/ r+ i ^% F& J+ i3 X1 \. e, A
root soft nproc unlimited( ^* C/ c* e: D/ m' o
" X2 u* T: C0 e# e% v1 g' H
H% O( }; `7 a9 q! ~3 b; h( O( w8 m5 w
) y8 _& |8 m, r6 b# d3 q4 x) }3 [4 X& U6 t$ q C' `7 r
|