Wednesday, December 15, 2010

Mac OS 10.6.5 + apachectl: /usr/sbin/apachectl: line 82: ulimit: open files: cannot modify limit: Invalid argumen

hit this error today, google found several mentions of this fix.

The fix worked for me.

From: http://blog.deversus.com/2010/11/mac-os-1065-apachectl-usrsbinapachectl-line-82-ulimit-open-files-cannot-modify-limit-invalid-argument/

Mac OS 10.6.5 + apachectl: /usr/sbin/apachectl: line 82: ulimit: open files: cannot modify limit: Invalid argument

After upgrading to Mac OS 10.6.5 this morning while working on Quote Manager, I went to restart apache via the “sudo apachectl restart” command and was presented with an obscure error message:

/usr/sbin/apachectl: line 82: ulimit: open files: cannot modify limit: Invalid argument
Since apachectl was working fine 5 minutes before I updated to Mac OS 10.6.5, I figured the two were related. After a quick dig into what the update entailed, I found that Apple updated to Apache 2.2.15, which patched a number of vulnerabilities (http://support.apple.com/kb/HT4435). It turned out that one of those changes broke the apachectl script. Referring to line 82 of apachectl, the shell script was referring to the ULIMIT_MAX_FILES variable, which was set to:

ULIMIT_MAX_FILES="ulimit -S -n `ulimit -H -n`"
Changing the line as follows fixed the problem:

ULIMIT_MAX_FILES=""

No comments:

Post a Comment