Sample Header Ad - 728x90

launchd: Confusion on semantics of bootstrap and bootout etc. after reading manual pages

19 votes
1 answer
15049 views
I've read the following manual pages on launchd: launchctl, launchd, and launchd.plist. However, nothing is really said in these manual pages regarding what the launchctl boostrap and launchctl bootout (sub)commands actually do (see below). Is it to be inferred from their names? Futhermore, I cannot find information in the man pages, regarding what user/group the service (agent/daemon) runs as. However, launchd.plist mentions UserName/GroupName for controlling the user/group for the system domain. So, what user are per-user services in /Library/LaunchAgents or ~/Library/LaunchAgents run as? Finally, I would expect I need to bootstrap/load my daemon's .plist, but after putting the .plist in /Library/LaunchAgents or /Library/LaunchDaemons, it was automatically loaded (run) at system boot. Indeed, RunAtLoad=true, but what's the purpose of bootstrap, if services run anyway? man launchctl: bootstrap | bootout domain-target [service-path service-path2 ...] | service-target Bootstraps or removes domains and services. When service arguments are present, bootstraps and correspondingly removes their definitions into the domain. Services may be specified as a series of paths or a service identifier. Paths may point to XPC service bundles, launchd.plist(5) s, or a directories containing a collection of either. If there were one or more errors while bootstrapping or removing a collection of services, the problematic paths will be printed with the errors that occurred. If no paths or service target are specified, these commands can either bootstrap or remove a domain specified as a domain target. Some domains will implicitly bootstrap pre-defined paths as part of their creation.
Asked by Shuzheng (1681 rep)
Aug 8, 2019, 09:51 AM
Last activity: Oct 7, 2023, 04:24 AM