本帖最後由 IT_man 於 2017-3-28 10:13 編輯
6 ~* p9 _' b3 V% ~' S* [. r8 v D0 } ?& V" k
徵狀:
1 L9 _" E" N" G/ N1 K
[$ f' ]) s2 ^$ k# }/ ?+ v& v: R i7 Q某天因為需要從root su 到一般的user,指令如下:
/ t0 A3 O+ q- p& o7 t7 j0 k* E/ K#su someuser 結果show error
5 ~$ h' w$ a3 |& ?% [5 tsu: cannot set user id: Resource temporarily unavailable
+ h+ o5 Z. |0 r5 M, x5 q( M; z' G* d9 O3 N) k
查了google得知根本原因是process 最大限制是 1024:
: F& F* W1 w. P
& c: O# U: N$ O$ l; H#cat /etc/security/limits.d/90-nproc.conf5 p0 b2 I- B) C2 C" ]) m1 [
# Default limit for number of user's processes to prevent, N: U- d) C \* y0 Z' S
# accidental fork bombs.9 d$ G R+ m, J
# See rhbz #432903 for reasoning.) y4 m8 Q) m; m
: T l6 z$ j8 [: y5 l* soft nproc 1024 ====>將1024改成大一點如4096就 OK
: F( M+ k1 B; _; Rroot soft nproc unlimited: N, n. N7 Y( F8 U
+ E* n9 a0 u. u, q6 }& A
9 C; A; N0 Y! ^7 t8 ?
% B1 o; p4 R5 K8 o! |8 y5 \$ \; n
4 N ]+ \) C+ h+ g4 J# m6 c' x
|
|