Global Launch Daemons: launchd

don’t need sudo because daemon is in home directory. to unload it so that it doesn’t reload on next login: use -w switch. this adds ‘disabled’ flag to the daemon.

launchctl unload -w /path/to/daemon

Save the file here:
/Library/LaunchDaemons/examplelaunchd.plist

set root permission:
sudo chown root /Library/LaunchDaemons/examplelaunchd.plist

sudo launchctl load -w /Library/LaunchDaemons/examplelaunchd.plist

You can stop the service using the unload subcommand.
sudo launchctl unload /Library/LaunchDaemons/examplelaunchd.plist

sudo launchctl list

Link:
https://serverfault.com/questions/194832/how-to-start-stop-restart-launchd-services-from-the-command-line

https://discussions.apple.com/thread/1872008

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
Share via
Copy link