The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SystemExecution in API_Linux.cpp:172: setuid() failed: Resource temporarily unavai...

Discussion in 'General Discussion' started by harty83, Feb 25, 2011.

  1. harty83

    harty83 Registered

    Joined:
    Feb 24, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I have a client who hosts with NetLogistics in Australia. A couple weeks ago, we started to get random 500 internal errors consistently on the site. Consistently being that we are getting the 500 errors but never the same script/url consistently. Its completely random. Everything worked just fine up until a couple weeks ago. Nothing was changed by any of us unless cPanel automatically did something.

    I've scoured the logs and the only thing recorded for these errors are similar to:

    [Fri Feb 25 15:48:55 2011] [error] [client 58.11.6.200] SystemException in API_Linux.cpp:172: setuid() failed: Resource temporarily unavailable, referer: http://mywebsite.com/myscript.php
    [Fri Feb 25 15:48:55 2011] [error] [client 58.11.6.200] Premature end of script headers: myscript.php, referer: http://mywebsite.com/myscript.php

    I use suPHP with PHP5 on a CentOS 5.2 server. I have checked, rechecked, and triple checked that ownership and permissions are correct (755 for directories, 644 for files; all owned by user and user's group). I don't think this is a permission issue because of the error's randomness.

    I have tried increasing PHP's memory_limit, max_execution_time, etc to no avail. I've tried increasing the number of Apache SpareServers, MaxClients, etc to no avail. I've turned all loglevel's to info but am given nothing.

    As far as I know, I have nothing installed that would limit the number of PHP processes unless cPanel has something native. But from what I have read, cPanel does not unless I install a custom suPHP module to limit processes and I have not done so.

    Any ideas? I'm pretty much at my wits end ;-)

    Thanks,
    Alan
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Re: SystemExecution in API_Linux.cpp:172: setuid() failed: Resource temporarily unava

    Can you please check if there are actually any RLimit settings in Apache's configuration on the machine?

    Code:
    grep -i rlimit /usr/local/apache/conf/httpd.conf
     
  3. harty83

    harty83 Registered

    Joined:
    Feb 24, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Re: SystemExecution in API_Linux.cpp:172: setuid() failed: Resource temporarily unava

    This is what I'm given:

    Code:
    [15:46:12][root@host:~]# grep -i rlimit /usr/local/apache/conf/httpd.conf
    RLimitCPU 240                                                                                                                                                                         
    RLimitNPROC 10                                                                                                                                                                        
    ServerLimit 250    
    
    Thanks,
    Alan
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Re: SystemExecution in API_Linux.cpp:172: setuid() failed: Resource temporarily unava

    Then you do have limits on your machine. The RLimitNPROC is the one causing the issue. It is limiting each user to 10 processes, which this account is hitting.

    You will need to comment out the setting entirely and restart Apache to see if that corrects the issue. If it does, then if this was enabled by using WHM > Memory Usage Restrictions area, then you will need to remove the RLimit entries in /var/cpanel/templates/apache2/main.default by copying that file to /var/cpanel/templates/apache2/main.local and then rebuild Apache:

    Code:
    cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak110305
    /scripts/rebuildhttpdconf
    /etc/init.d/httpd restart
     
  5. tekops

    tekops Registered

    Joined:
    Jun 2, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I know this is old, but the issue can still creep up and there is additional information I hope will save someone else some time--

    We had the same issue, but you need to check the other file... I'm quoting someone else here because they said it better than I:

    They resolved the issue by increasing the limit to 50 by editing the /usr/local/apache/conf/includes/pre_main_global.conf file. The setting is "RLimitNPROC 25 30". Change the first number to the new limit, then add 5 to get the second number, and finally restart Apache. ​

    Of all the places I looked, this was the only place that mentioned the pre_main_global.conf file.

    Thanks,
    D
     
    #5 tekops, Feb 19, 2016
    Last edited by a moderator: Feb 22, 2016

Share This Page