Control Apple's
launchd
manager for launch daemons (system-wide services) and launch agents (per-user programs).launchd
loads XML-based*.plist
files placed in the appropriate locations, and runs the corresponding commands according to their defined schedule. More information: https://keith.github.io/xcode-man-pages/launchctl.1.html.
launchd
whenever the user logs in:launchctl load ~/Library/LaunchAgents/{{my_script}}.plist
~
in the path):sudo launchctl load /Library/LaunchAgents/{{root_script}}.plist
sudo launchctl load /Library/LaunchDaemons/{{system_daemon}}.plist
launchctl list
launchd
after a reboot and/or logging in):launchctl unload ~/Library/LaunchAgents/{{my_script}}.plist
launchctl start {{script_file}}
launchctl stop {{script_file}}