本帖最後由 IT_man 於 2017-3-28 10:13 編輯 ( a; n9 X+ X; W
" L$ B5 O) E U. ?% o8 [
徵狀:5 E8 G2 s) `% R6 Q* m) q9 t
. b4 c2 N: L' E& _7 b
某天因為需要從root su 到一般的user,指令如下: ~" P7 C6 t/ ?" O7 A4 [0 M
#su someuser 結果show error
' e( g$ g- t+ g* s; V& Nsu: cannot set user id: Resource temporarily unavailable, g6 A8 {; n( S
' s8 _. |* k6 ] Y查了google得知根本原因是process 最大限制是 1024:
! Z/ I! r3 u5 S% b# v/ r* G6 w3 X+ _) p& C, m, r
#cat /etc/security/limits.d/90-nproc.conf5 E/ N1 B! h- }- [
# Default limit for number of user's processes to prevent
! R7 P: e8 k+ b# accidental fork bombs.& G$ v; y! g* Z5 N: g
# See rhbz #432903 for reasoning.
. ?- D" ?0 L4 t: f0 F
8 |" u9 u* R- b1 B7 ]/ H$ f0 {* soft nproc 1024 ====>將1024改成大一點如4096就 OK! u3 t/ W$ G. U# p% c, r
root soft nproc unlimited( d4 K, [* y* r- V2 _9 f, H! I- m" D
, Q2 Y8 G8 w# v( q1 \( l: b
, _- c; |$ t `
1 H9 p0 ]/ _# T" M, A5 g% S! x$ ]2 q- Y% o
- R2 q" D' u' ~1 } |
|