zoukankan      html  css  js  c++  java
  • -bash: fork: retry: Resource temporarily unavailable

    For me, I got the same error message but had a different solution.
    Cron failed with : (CRON) ERROR (setreuid failed): Resource temporarily unavailable
    Bash logins failed as described in the main topic (no disk access was allowed, but built in bash functions could be used like pwd or echo).

    The fix was to edit /etc/security/limits.conf
    My process was "apache" so I added 
    apache soft nproc 2000

    If you want it for all users, change apache to *


    This is commonly caused by running out of file descriptors. 

    There are different file descriptor limits.

    There is the systems total file descriptor limit, what do you get from the command:

    CODE: SELECT ALL
    sysctl fs.file-nr


    From this command you will get 3 numbers. First is the number of used file descriptor the second is the number of allocated but not used file descriptor and the last is the system max file descriptor. If either of the first two numbers are new otr at the third you need to increase the number of file descriptors for the system of find out what is consuming them. 

    If the total of the used system file descriptors is not near the max it may be a user limit. 

    To find out what a users file descriptor limit is run the commands:

    CODE: SELECT ALL
    sudo su - UID
    ulimit -Hn


    Replace UID with the user ID is the user you want to check, or if you are already logged in as that user just run the ulimit command. 

    To find out how many file descripters are in use by a user run the command:

    CODE: SELECT ALL
    sudo lsof -u UID 2>/dev/null | wc -l



    So now if you are having a system file descriptor limit issue you will need to edit your /etc/sysctl.conf file and add, or modify it it already exists, a line with fs.file-max and set it to a value large enough to deal with the number of file descriptors you need and reboot. 

    The line would look somehting like:

    CODE: SELECT ALL
    fs.file-max = 204708



    If it is a individual users file descriptor limit then you will have to update the users limits in the /etc/security/limits.conf file with an entry like:

    CODE: SELECT ALL
    UID soft nofile 4096
    UID hard nofile 10240


    Once again you will have to replace UID with the user ID of the account with the issue.

  • 相关阅读:
    BZOJ3197:[SDOI2013]刺客信条——题解
    C 程序与 C++ 程序之间的相互调用
    使用Dev C++调试(debug)程序
    ARM 汇编指令 ADR 与 LDR 使用
    华为交换机以 LACP 模式实现链路聚合
    DLCI 简介
    华为路由器帧中继 FR 实验
    GVRP 的工作机制和工作模式
    华为路由器 HDLC 实验
    华为路由器 IPSec 与 GRE 结合实验
  • 原文地址:https://www.cnblogs.com/sanquanfeng/p/5092934.html
Copyright © 2011-2022 走看看