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.

  • 相关阅读:
    二叉树的前序、中序、后序遍历
    队列&优先队列
    angularJS 初始化
    angularJS $q
    获取checkbox返回值
    ngRoute
    两个类的装饰器,内置的魔术方法
    super封装property反射
    广度优先和深度优先 父类对子类的约束 多态 鸭子模型
    继承
  • 原文地址:https://www.cnblogs.com/sanquanfeng/p/5092934.html
Copyright © 2011-2022 走看看