tid=59112& 本帖最後由 IT_man 於 2017-3-28 10:13 編輯
J; L/ h: {! H3 A7 y/ O8 L- o
4 h h) g6 B5 f) G. j& \2 ~* u徵狀:% ^# e5 H5 G" R; `/ j
/ p' w( o d- h; R3 P6 z4 A0 d某天因為需要從root su 到一般的user,指令如下:! E% S% t' e, l' D; }
#su someuser 結果show error
6 j: L2 C" U) @ X2 usu: cannot set user id: Resource temporarily unavailable
- Z% z$ X3 D! z' R; T. \6 m& g
! U! X C0 e6 ^* o* a- E' o查了google得知根本原因是process 最大限制是 1024:* A: F3 U, N1 r; S w( S# g
5 ~% S3 P5 L7 @/ y n& c# r
#cat /etc/security/limits.d/90-nproc.conf% D! P' @4 N" ~
# Default limit for number of user's processes to prevent' e& F! f% P. @6 o+ B
# accidental fork bombs.
q4 z; _9 w1 Y8 Q: d* D# See rhbz #432903 for reasoning.
$ h7 G; [" A5 v% [' M, w/ l
& J4 p0 ]# G7 i4 g; j* soft nproc 1024 ====>將1024改成大一點如4096就 OK
% b5 J$ M3 d5 V9 S) Lroot soft nproc unlimited# E' ?3 V a5 K$ y/ U
0 Y- x! j- |' b8 o5 a7 a
" D/ M/ t1 G! D" s
" F% `" ]5 U, a0 ` c5 m) n7 Q: X- Y2 F5 V4 y
7 _2 [! I9 d' V- {; N3 O( H/ g ^
|