How to load system-wide daemon on Mac OS X

8,259

In order to load the job for everyone you need to run launchctl under root privileges. If the job is already loaded under your user account, it won't load using root privileges instead.

Try running launchctl unload /Library/LaunchDaemons/myPlistFileName first before running sudo launchctl load -w /Library/LaunchDaemons/myPlistFileName. Take a look at the output in system.log (you can view it using Console.app if you'd prefer) that occurs when you load the daemon.

Share:
8,259

Related videos on Youtube

Chealion
Author by

Chealion

Chealion - http://chealion.ca IT Manager at a television production company in Calgary, Alberta

Updated on September 17, 2022

Comments

  • Chealion
    Chealion almost 2 years

    I'm trying to load my daemon-app with this command

    launchctl load /Library/LaunchDaemons/myPlistFileName
    

    It works fine, but only while my user is logged in on system.

    How can I load my deamon-app, which will stay loaded without any user logged into the system (like the windows-services)??

    The command

    sudo launchctl load /Library/LaunchDaemons/myPlistFileName
    

    give me an error -> nothing found to load

    Which is the right way to do this?

  • geekinit
    geekinit over 11 years
    Was stuck on this one. Thanks. The man page says the -w clears the Disabled key which has been moved outside the plist.