4

On macOS (Darwin, 4.4BSD derivative), you have this nifty process manager called launchd controlled by launchctl analog to systemd and systemctl.

Executing launchctl alone yields a list of subcommands. Among them are bootstrap and load. What is(are) the difference(s) between them?

Subcommands:
    bootstrap       Bootstraps a domain or a service into a domain.
    bootout         Tears down a domain or removes a service from a domain.
    enable          Enables an existing service.
    disable         Disables an existing service.
    uncache         Removes the specified service name from the service cache.
    kickstart       Forces an existing service to start.
    attach          Attach the system's debugger to a service.
    debug           Configures the next invocation of a service for debugging.
    kill            Sends a signal to the service instance.
    blame           Prints the reason a service is running.
    print           Prints a description of a domain or service.
    print-cache     Prints information about the service cache.
    print-disabled  Prints which services are disabled.
    plist           Prints a property list embedded in a binary (targets the Info.plist by default).
    procinfo        Prints port information about a process.
    hostinfo        Prints port information about the host.
    resolveport     Resolves a port name from a process to an endpoint in launchd.
    limit           Reads or modifies launchd's resource limits.
    runstats        Prints performance statistics for a service.
    examine         Runs the specified analysis tool against launchd in a non-reentrant manner.
    config          Modifies persistent configuration parameters for launchd domains.
    dumpstate       Dumps launchd state to stdout.
    dumpjpcategory  Dumps the jetsam properties category for all services.
    reboot          Initiates a system reboot of the specified type.
    bootshell       Brings the system up from single-user mode with a console shell.
    load            Bootstraps a service or directory of services.
    unload          Unloads a service or directory of services.
    remove          Unloads the specified service name.
    list            Lists information about services.
    start           Starts the specified service.
    stop            Stops the specified service if it is running.
    setenv          Sets the specified environment variables for all services within the domain.
    unsetenv        Unsets the specified environment variables for all services within the domain.
    getenv          Gets the value of an environment variable from within launchd.
    bsexec          Execute a program in another process' bootstrap context.
    asuser          Execute a program in the bootstrap context of a given user.
    submit          Submit a basic job from the command line.
    managerpid      Prints the PID of the launchd controlling the session.
    manageruid      Prints the UID of the current launchd session.
    managername     Prints the name of the current launchd session.
    error           Prints a description of an error.
    variant         Prints the launchd variant.
    version         Prints the launchd version.
    help            Prints the usage for a given subcommand.
2
  • Have you read the man page for launchctl? In Terminal: man launchctl – user3439894 Apr 3 '17 at 19:29
  • @user3439894 Of course! It is not clear. It assumes I have more knowledge than I currently do. – Jonathan Komar Apr 14 '17 at 4:47
3

Apple rewrote launchd in OS X Yosemite (10.10)

As far as I understand it, they added bootstrap | bootout as replacements for load | unload. load | unload are currently listed under LEGACY SUBCOMMANDS in the launchctl manual.

The main difference when you're just trying to load or unload an agent/daemon is that bootstrap | bootout forces you to be explicit about the target domain that the agent/daemon will be loaded into.

Check out this great Blog Post about some of the changes to the launchctl syntax in the OS X Yosemite launchd rewrite for more details about everything I just touched on.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .