How do you set the maxopenfiles limit in Yosemite?

How do you set a soft limit for maxopenfiles in Yosemite?

I installed Yosemite last night, and now it's ignoring my settings in my /etc/launchd.conf file:

$ cat /etc/launchd.conf
limit maxfiles 32768 65536

$ launchctl limit maxfiles
    maxfiles    256            unlimited

It looks like Apple removed support for /etc/launchd.conf for security reasons. It no longer exists on a clean Yosemite install.

From the man launchctl file:

launchctl no longer has an interactive mode, nor does it accept commands from stdin. The /etc/launchd.conf file is no longer consulted for subcommands to run during early boot time; this functionality was removed for security considerations.


I created a /etc/sysctl.conf file with the following contents:

kern.maxfiles=100000

If I run sysctl kern.maxfiles after restarting it does show the new value there.