sharewind
V2EX  ›  Ubuntu

ubuntu 14.04 (trusty)如何给非 root 用户设置 ulimit 打开文件数

  •  
  •   sharewind · May 7, 2014 · 8675 views
    This topic created in 4585 days ago, the information mentioned may be changed or developed.
    ➜ sudo sysctl -a|grep file
    fs.file-max = 2037581
    fs.file-nr = 2784 0 2037581

    ➜ ~ cat /proc/sys/fs/file-max
    2037581
    ➜ ~ cat /proc/sys/fs/file-nr
    2720 0 2037581

    /etc/security/limits.conf
    * hard nofile 2037581
    * soft nofile 2037581
    root hard nofile 2037581
    root soft nofile 2037581

    /etc/pam.d/su
    session required pam_limits.so

    /etc/pam.d/common-session
    session required pam_limits.so

    reboot后仍然只能ulimit -n 4096, 再大就报
    ulimit: value exceeds hard limit
    2 replies  •  2014-05-07 15:50:02 +08:00
    rrfeng
    rrfeng
    May 7, 2014❤️1
    1
    USERNAME hard nofile 2037581
    USERNAME soft nofile 2037581
    cevincheung
    cevincheung
    May 7, 2014
    2
    /etc/security/limits.conf

    * - nofile N
    root - nofile N
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1098 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 23:27 · PVG 07:27 · LAX 15:27 · JFK 18:27
    ♥ Do have faith in what you're doing.