Difference between revisions of "Launchctl (command)"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Tags: Mobile web edit, Mobile edit
Line 10: Line 10:
 
* <code>sudo launchctl list</code>
 
* <code>sudo launchctl list</code>
 
* <code>sudo launchctl load -w /System/Library/LaunchDaemons/[[ssh.plist]]</code><ref>https://serverfault.com/questions/194832/how-to-start-stop-restart-launchd-services-from-the-command-line</ref>
 
* <code>sudo launchctl load -w /System/Library/LaunchDaemons/[[ssh.plist]]</code><ref>https://serverfault.com/questions/194832/how-to-start-stop-restart-launchd-services-from-the-command-line</ref>
* <code>sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist</code>
+
* <code>sudo [[launchctl unload]] -w /System/Library/LaunchDaemons/ssh.plist</code>
 
* <code>sudo launchctl stop /System/Library/LaunchDaemons/YOUR_DAEMON.[[plist]]</code><ref>https://serverfault.com/questions/194832/how-to-start-stop-restart-launchd-services-from-the-command-line</ref>
 
* <code>sudo launchctl stop /System/Library/LaunchDaemons/YOUR_DAEMON.[[plist]]</code><ref>https://serverfault.com/questions/194832/how-to-start-stop-restart-launchd-services-from-the-command-line</ref>
 
* <code>sudo launchctl start /System/Library/LaunchDaemons/YOUR_DAEMON.plist</code>
 
* <code>sudo launchctl start /System/Library/LaunchDaemons/YOUR_DAEMON.plist</code>

Revision as of 15:03, 23 August 2020

launchctl[1] macOS (command) interfaces with launchd daemon to load, unload daemons/agents and generally control launchd.

Folders

  • /System/Library/LaunchDaemons
  • /System/Library/LaunchAgents
  • /Library/LaunchDaemons


Commands

  • sudo launchctl list
  • sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist[2]
  • sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist
  • sudo launchctl stop /System/Library/LaunchDaemons/YOUR_DAEMON.plist[3]
  • sudo launchctl start /System/Library/LaunchDaemons/YOUR_DAEMON.plist
sudo launchctl stop com.openssh.sshd (it will automatically restart). See also: Activate SSH server on macOS

See also

  • https://ss64.com/osx/launchctl.html
  • https://serverfault.com/questions/194832/how-to-start-stop-restart-launchd-services-from-the-command-line
  • https://serverfault.com/questions/194832/how-to-start-stop-restart-launchd-services-from-the-command-line
  • https://wiki.ubuntu.com/DebuggingSystemd
  • Advertising: