tid=59112& 本帖最後由 IT_man 於 2017-3-28 10:13 編輯 , Q0 q) ?1 \ H9 V/ {0 H' c: t
- I7 m* d# x; c8 [* A8 G7 m徵狀:
1 Q g: O0 a2 ^) o' }3 z9 F; L+ w
0 K% ^$ j, m l某天因為需要從root su 到一般的user,指令如下:
- v& V3 t& P" w e8 z#su someuser 結果show error/ t/ q: Y+ [, f3 e T; a) ]
su: cannot set user id: Resource temporarily unavailable
9 [6 C9 _$ Y3 u: y
1 A) [/ h: A) l- v" y: z查了google得知根本原因是process 最大限制是 1024:
. p- x5 l6 y3 x1 @# y2 D; }; t( y
" J6 R" S% C3 b% X5 S0 P#cat /etc/security/limits.d/90-nproc.conf
" i# m5 i6 I; N' |6 N# Default limit for number of user's processes to prevent& Z" y0 n% _. O I8 I6 W
# accidental fork bombs.& q8 T; ?3 }! R% P4 ~% w
# See rhbz #432903 for reasoning.. _& T2 ^# S# b$ Y5 j* @$ d* i6 }
, U9 u' N+ T( Q- I) K9 f
* soft nproc 1024 ====>將1024改成大一點如4096就 OK
4 D4 ^4 C6 ?) S. L3 q/ g S7 |root soft nproc unlimited
* }6 B" N5 ^$ j1 p2 X3 i/ Z% g
3 A! n) n) d# c
M! G9 ?$ w, F% q! m, f" m; y4 T/ e1 U/ T8 c( g1 s2 D; d2 G5 U; `7 Z" ~
: p# W" x/ b% I) g9 z
1 N4 r9 h" T5 ]) b' n5 T
|