Setting environment variables via launchd.conf no longer works in OS X Yosemite/El Capitan/macOS Sierra/Mojave?

前端 未结 9 1386
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 08:07

It looks like the launchd.conf does not load my environment variable anymore. Has anyone else noticed that?

Is there another solution to permanently set

9条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 08:20

    What did work for me (inspired from aax' thanks) :

    Paste this into /Library/LaunchDaemons/com.apple.launchd.limit.plist then reboot :

    
    
      
      
      Label
      eicar
      ProgramArguments
      
        /bin/launchctl
        limit
        maxfiles
        16384
        16384
      
      RunAtLoad
      
      ServiceIPC
      
    
    
    

    If you need it step by step :

    • Launch terminal
    • Type sudo su then enter your password to log in as root
    • Type vi /Library/LaunchDaemons/com.apple.launchd.limit.plist
    • When into the vi editor, press the key i to enter insert mode then paste the exact code content above (⌘+v). This will force the limit to 16384 files per process and 16384 files total
    • Save your file and quit using esc then :wq
    • Reboot your system, and check that it is working using the command launchctl limit

    I hope this helped you.

提交回复
热议问题