本帖最後由 IT_man 於 2017-3-28 10:13 編輯 ' f' w J# d" F) ]
& ^0 a7 C) x! X3 ?( R \, w徵狀:- {* p( b+ X- A/ l
$ u* d& ]/ s) Q$ t4 v& ~$ ?
某天因為需要從root su 到一般的user,指令如下:
! ^3 L5 `( b7 \* I#su someuser 結果show error
! z/ L0 f- `! U( X& Q. s( g' {+ wsu: cannot set user id: Resource temporarily unavailable
0 N7 d! Z7 L* x+ j' ~) g8 N" `
9 o4 U* U& P/ B3 \5 Z查了google得知根本原因是process 最大限制是 1024:
' ]( [0 a' n1 X- U) m( N: T& }/ C9 S; Q5 W
#cat /etc/security/limits.d/90-nproc.conf
; [3 B; C" d9 w# Default limit for number of user's processes to prevent9 L! s& b1 I+ Z& M( c* j. i6 g
# accidental fork bombs.
: J- ~. [" `: w, F l U7 a# See rhbz #432903 for reasoning.: J+ B8 s* a4 j" [$ u' V
. O. A$ s* b/ ?+ A2 h2 u% H
* soft nproc 1024 ====>將1024改成大一點如4096就 OK
2 t& x9 t) j/ broot soft nproc unlimited
, `* k( [# M% y
7 @5 r1 m5 a. `! c6 W e1 f! c% T$ _! U' D. j0 y$ `
! S7 u& f/ R4 J+ u3 x/ A9 k( ^, B t0 O' Z; a0 V
3 [6 p% o! {6 Y1 g2 T
|
|