Mac launchd: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 1: Line 1:
=External=
=External=
 
* https://www.launchd.info
* https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html
* https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html



Revision as of 18:07, 8 October 2024

External

Internal

Overview

brew can configure services to be started by launchd.

launchd identifies services by their "labels" (example: "com.apple.bluetoothd").

Operations

Enable a Service to Start at Boot

The following command will configure launchd to start the program designated by <name> at boot. It does not start it immediately.

launchctl enable <name>

Prevent a Service to Start at Boot

A program that was previously enabled to start at boot with launchctl enable can be prevented to start at boot with:

launchctl disable <name>

Start a Service

launchctl start <name>

Stop a Service

launchctl stop <name>


Show Status of a Service

launchctl list com.apple.bluetoothd

Stop a Service

Organizatorium

System httpd keeps starting in foreground

I fixed with:

launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

but I don't know what determined it to suddenly start, and why the above command worked.

Is a Service Running?

launchctl list | grep com.something.someprocess