@zukhruf/launchd 0.0.0-stage → 0.8.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +670 -2
  3. package/dist/errors.d.ts +27 -0
  4. package/dist/errors.d.ts.map +1 -0
  5. package/dist/errors.js +46 -0
  6. package/dist/errors.js.map +1 -0
  7. package/dist/index.d.ts +18 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +5 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/job/absolute-path.d.ts +5 -0
  12. package/dist/job/absolute-path.d.ts.map +1 -0
  13. package/dist/job/absolute-path.js +6 -0
  14. package/dist/job/absolute-path.js.map +1 -0
  15. package/dist/job/agent-job.d.ts +8 -0
  16. package/dist/job/agent-job.d.ts.map +1 -0
  17. package/dist/job/agent-job.js +2 -0
  18. package/dist/job/agent-job.js.map +1 -0
  19. package/dist/job/calendar-interval.d.ts +10 -0
  20. package/dist/job/calendar-interval.d.ts.map +1 -0
  21. package/dist/job/calendar-interval.js +2 -0
  22. package/dist/job/calendar-interval.js.map +1 -0
  23. package/dist/job/daemon-job.d.ts +10 -0
  24. package/dist/job/daemon-job.d.ts.map +1 -0
  25. package/dist/job/daemon-job.js +2 -0
  26. package/dist/job/daemon-job.js.map +1 -0
  27. package/dist/job/job-file.d.ts +21 -0
  28. package/dist/job/job-file.d.ts.map +1 -0
  29. package/dist/job/job-file.js +103 -0
  30. package/dist/job/job-file.js.map +1 -0
  31. package/dist/job/job.d.ts +67 -0
  32. package/dist/job/job.d.ts.map +1 -0
  33. package/dist/job/job.js +2 -0
  34. package/dist/job/job.js.map +1 -0
  35. package/dist/job/keep-alive-conditions.d.ts +15 -0
  36. package/dist/job/keep-alive-conditions.d.ts.map +1 -0
  37. package/dist/job/keep-alive-conditions.js +2 -0
  38. package/dist/job/keep-alive-conditions.js.map +1 -0
  39. package/dist/job/launch-events.d.ts +17 -0
  40. package/dist/job/launch-events.d.ts.map +1 -0
  41. package/dist/job/launch-events.js +2 -0
  42. package/dist/job/launch-events.js.map +1 -0
  43. package/dist/job/mach-service.d.ts +5 -0
  44. package/dist/job/mach-service.d.ts.map +1 -0
  45. package/dist/job/mach-service.js +2 -0
  46. package/dist/job/mach-service.js.map +1 -0
  47. package/dist/job/property-list-value.d.ts +5 -0
  48. package/dist/job/property-list-value.d.ts.map +1 -0
  49. package/dist/job/property-list-value.js +2 -0
  50. package/dist/job/property-list-value.js.map +1 -0
  51. package/dist/job/resource-limits.d.ts +13 -0
  52. package/dist/job/resource-limits.d.ts.map +1 -0
  53. package/dist/job/resource-limits.js +2 -0
  54. package/dist/job/resource-limits.js.map +1 -0
  55. package/dist/job/socket.d.ts +37 -0
  56. package/dist/job/socket.d.ts.map +1 -0
  57. package/dist/job/socket.js +2 -0
  58. package/dist/job/socket.js.map +1 -0
  59. package/dist/launchctl/cancel-options.d.ts +5 -0
  60. package/dist/launchctl/cancel-options.d.ts.map +1 -0
  61. package/dist/launchctl/cancel-options.js +2 -0
  62. package/dist/launchctl/cancel-options.js.map +1 -0
  63. package/dist/launchctl/domain.d.ts +3 -0
  64. package/dist/launchctl/domain.d.ts.map +1 -0
  65. package/dist/launchctl/domain.js +2 -0
  66. package/dist/launchctl/domain.js.map +1 -0
  67. package/dist/launchctl/launchctl.d.ts +17 -0
  68. package/dist/launchctl/launchctl.d.ts.map +1 -0
  69. package/dist/launchctl/launchctl.js +98 -0
  70. package/dist/launchctl/launchctl.js.map +1 -0
  71. package/dist/launchd/launchd.d.ts +30 -0
  72. package/dist/launchd/launchd.d.ts.map +1 -0
  73. package/dist/launchd/launchd.js +65 -0
  74. package/dist/launchd/launchd.js.map +1 -0
  75. package/dist/service/service-state.d.ts +13 -0
  76. package/dist/service/service-state.d.ts.map +1 -0
  77. package/dist/service/service-state.js +2 -0
  78. package/dist/service/service-state.js.map +1 -0
  79. package/dist/service/service.d.ts +35 -0
  80. package/dist/service/service.d.ts.map +1 -0
  81. package/dist/service/service.js +58 -0
  82. package/dist/service/service.js.map +1 -0
  83. package/package.json +50 -4
package/README.md CHANGED
@@ -1,3 +1,671 @@
1
- # Temporary Holding Version
1
+ # @zukhruf/launchd
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ launchd starts and stops the daemons and agents of macOS. A program that must run with no terminal, at login, on a schedule, or again after a crash, gives launchd a job: a property list file in the format of launchd.plist(5). `launchctl` loads the job into a domain, and launchd runs it as a service. Each program that does this must answer the same questions. Which domain is right? Which subcommands of `launchctl` are right, now that Apple calls `load` and `unload` legacy? How does a changed job replace the service that runs? When has launchd let go of the old service? What does each exit code of `launchctl` mean? This package answers them once.
4
+
5
+ It runs `/bin/launchctl` with the current subcommands of launchctl(1): `bootstrap`, `bootout`, `enable`, `disable`, `kickstart`, `kill` and `print` ([ADR 0001](./docs/adr/0001-launchctl-is-the-interface-and-only-its-current-subcommands.md)). A job is a TypeScript type with the keys of launchd.plist(5), in Apple's names ([ADR 0002](./docs/adr/0002-a-job-is-the-typed-launchd-plist-with-apples-key-names.md)). The package depends on `@zukhruf/async`, `@zukhruf/fs` and `plist`. It works only on macOS.
6
+
7
+ The words in these documents have one meaning each. See the glossary in [CONTEXT.md](./CONTEXT.md). The decisions are in the [ADRs](./docs/adr/). The man pages are on each Mac: `man 5 launchd.plist`, `man 1 launchctl` and `man 3 xpc_events`. A line number in these documents is a line of `man -P cat <section> <page> | col -b | cat -n` on macOS 27.2.
8
+
9
+ ## Install a job
10
+
11
+ `Launchd.agents()` gives the agents of this user. `install()` writes the job to its job file, `<Label>.plist` in the folder of the domain, and loads it ([ADR 0003](./docs/adr/0003-install-is-a-reconcile-that-enables-then-bootstraps.md)).
12
+
13
+ ```ts
14
+ import { Launchd } from '@zukhruf/launchd';
15
+
16
+ const launchd = Launchd.agents({ clock: globalThis });
17
+ const service = await launchd.install({
18
+ Label: 'com.example.sync',
19
+ ProgramArguments: ['/opt/homebrew/bin/node', '/Users/me/sync/main.js'],
20
+ KeepAlive: true,
21
+ StandardErrorPath: '/Users/me/Library/Logs/sync.log',
22
+ });
23
+ console.log(launchd.domain, service.target, service.file);
24
+ // gui/501 gui/501/com.example.sync /Users/me/Library/LaunchAgents/com.example.sync.plist
25
+ ```
26
+
27
+ `clock` is the clock of the waits of the package: the wait between two bootouts, and the wait of the atomic write of `@zukhruf/fs`. Give `globalThis` in production. It has no default ([root ADR 0004](../../docs/adr/0004-a-library-that-waits-takes-the-clock-as-an-input.md)).
28
+
29
+ An install is a reconcile. It renders the job to the bytes of its job file, and compares them with the file that is there:
30
+
31
+ - **The same bytes, and the service is loaded.** The install does nothing. A second install of the same job does not restart the process.
32
+ - **The same bytes, and the service is not loaded.** The install enables the service and bootstraps it.
33
+ - **Other bytes, or no file.** The install boots out the old service, and waits until launchd forgets it. It writes the job file with mode `0644` in one step. Then it enables the service and bootstraps it. Thus a changed job replaces the old service, and launchd reads the new file. An install that fails or stops halfway leaves the old bytes in the file, so the next install does the work again.
34
+ - **A label that is not one file name.** The label names the job file. An empty label, a label with `/` or a NUL character, and the labels `.` and `..` throw a `RangeError` before any file or launchctl call.
35
+
36
+ The package sorts the keys of each dictionary before it renders them, so the order of the keys in your object does not change the bytes ([ADR 0008](./docs/adr/0008-the-job-file-is-rendered-by-the-plist-package-with-sorted-keys.md)).
37
+
38
+ A bootstrap starts the process only when the job asks for it: with `RunAtLoad`, or with `KeepAlive`, which "implicitly implies RunAtLoad" (launchd.plist(5), lines 196-197). Else launchd waits for the launch conditions of the job, or for `kickstart()`.
39
+
40
+ A signal cancels the wait for the old service. The install then rejects with the reason of the signal. The old job file stays, and launchd goes on with the bootout. The next install finds other bytes, and does the work again.
41
+
42
+ ## Run the service now, and restart it
43
+
44
+ `kickstart()` makes launchd "run the specified service immediately, regardless of its configured launch conditions" (launchctl(1), lines 97-99). It gives the PID of the new process, or of the process that runs.
45
+
46
+ `kickstart({ kill: true })` kills the process that runs, and launchd starts it again (`kickstart -k`). This is a restart without a reload: launchd keeps the job that it loaded, and does not read the job file again. To change the job, install the changed job.
47
+
48
+ ```ts
49
+ const pid = await service.kickstart();
50
+ const restarted = await service.kickstart({ kill: true });
51
+ ```
52
+
53
+ When launchd has no such service in the domain, `kickstart()` rejects with `ServiceNotFoundError`.
54
+
55
+ ## Send a process signal
56
+
57
+ `kill()` sends a process signal to the process of the service "if it is running" (launchctl(1), lines 198-201). It takes the name or the number of the signal.
58
+
59
+ ```ts
60
+ await service.kill('SIGHUP');
61
+ await service.kill(15);
62
+ ```
63
+
64
+ When the service is loaded and has no process, launchctl exits 3 (No process to signal), and `kill()` rejects with `LaunchctlError`. When launchd has no such service in the domain, `kill()` rejects with `ServiceNotFoundError`.
65
+
66
+ A job with `KeepAlive: true` starts again after its process ends. By default, launchd starts a job at most once every 10 seconds (`ThrottleInterval`, launchd.plist(5), lines 325-328).
67
+
68
+ ## Read the state
69
+
70
+ `state()` runs `launchctl print <service-target>` one time. It gives one of three states:
71
+
72
+ ```ts
73
+ const state = await service.state();
74
+ switch (state.state) {
75
+ case 'not loaded':
76
+ break;
77
+ case 'running':
78
+ console.log(state.pid, state.lastExitStatus);
79
+ break;
80
+ case 'not running':
81
+ console.log(state.lastExitStatus);
82
+ break;
83
+ }
84
+ ```
85
+
86
+ - `not loaded`: launchd has no service with the label in the domain. `print` exits 113.
87
+ - `running`: the service has a process, with its `pid`.
88
+ - `not running`: the service is loaded, and has no process now.
89
+
90
+ `pid` and `lastExitStatus` come from two lines of the output: `pid =` and `last exit code =`. Apple says that the output of `print` "is NOT API in any sense at all" (launchctl(1), lines 222-224). [ADR 0006](./docs/adr/0006-the-state-of-one-service-comes-from-print-and-only-two-of-its-lines.md) says why the package reads it, and how it stays safe.
91
+
92
+ `lastExitStatus` is `undefined` when launchd shows no number: `(never exited)`, or no `last exit code` line. On macOS 27.2, a process that a process signal ended shows `last terminating signal = Terminated: 15` and no `last exit code`, and a service that the system ended for memory (a jetsam exit) shows `last exit reason` and no `last exit code`.
93
+
94
+ ## Enable and disable
95
+
96
+ `disable()` sets the disabled override of the label. launchd then refuses to load the service in the domain until `enable()`, also after a restart of the computer (launchctl(1), lines 90-95): `bootstrap()` rejects with `LaunchctlError`, exit code 5 (Input/output error). launchd keeps the override itself, apart from the job file. A disable changes only the next loads: boot out a loaded service too.
97
+
98
+ ```ts
99
+ await service.bootout();
100
+ await service.disable(); // the next login does not load it
101
+
102
+ await service.enable();
103
+ await service.bootstrap();
104
+ ```
105
+
106
+ Both take a label that is not loaded: `install()` enables the service before it bootstraps it, as Homebrew does (`cli.rb:465-473`). Thus an install undoes a disable.
107
+
108
+ ## Unload and load again
109
+
110
+ `bootout()` removes the service from the domain. launchd stops the process and forgets the service. The job file stays in the folder, and "Some domains will implicitly bootstrap pre-defined paths as part of their creation" (launchctl(1), lines 85-88). Thus an enabled agent loads again at the next login.
111
+
112
+ launchd answers a bootout before the process is gone, and refuses a bootstrap of the label until then. Thus `bootout()` runs `launchctl bootout` again every second. While the process still ends, launchd answers 0 again on macOS 27.2. Homebrew and context-compiler also wait on 36 (Operation now in progress), and so does the package. When launchd has forgotten the service, it answers 3 (No such process), and `bootout()` resolves ([ADR 0004](./docs/adr/0004-a-bootout-is-repeated-until-launchd-forgets-the-service.md)). launchd sends `SIGTERM` to the process, and `SIGKILL` after the `ExitTimeOut` of the job (launchd.plist(5), lines 319-323). A signal cancels the wait.
113
+
114
+ `bootstrap()` loads the job file into the domain again.
115
+
116
+ ```ts
117
+ await service.bootout({ signal: AbortSignal.timeout(30_000) });
118
+ await service.bootstrap();
119
+ ```
120
+
121
+ A bootout of a service that is not loaded resolves at once.
122
+
123
+ ## Uninstall
124
+
125
+ `uninstall()` boots the service out, waits as `bootout()` does, and removes the job file. It resolves also when the service is not loaded and there is no file.
126
+
127
+ ```ts
128
+ await service.uninstall({ signal: AbortSignal.timeout(30_000) });
129
+ ```
130
+
131
+ launchd keeps the override of the label after an uninstall. A later install of the same label enables it again.
132
+
133
+ ## List the installed jobs
134
+
135
+ `installed()` lists the files `*.plist` in the folder of the domain, sorted by name. It gives a `Service` for each file, with the label from the file name. launchd.plist(5) asks that a job file is named `<Label>.plist` (lines 59-62). A name that gives no label, such as `.plist`, is not listed. `installed()` does not read the files. When the folder does not exist, the list is empty.
136
+
137
+ ```ts
138
+ for (const service of await launchd.installed()) {
139
+ console.log(service.label, (await service.state()).state);
140
+ }
141
+ ```
142
+
143
+ The folder of agents holds the job files of other programs too, and `installed()` lists them.
144
+
145
+ `service(label)` gives the handle of one label in the domain. It reads nothing and runs nothing. A label that is not one file name throws the `RangeError` of `install()`, so `uninstall()` never removes a file outside the folder.
146
+
147
+ ```ts
148
+ const sync = launchd.service('com.example.sync');
149
+ if ((await sync.state()).state === 'not loaded') await sync.bootstrap();
150
+ ```
151
+
152
+ ## Daemons
153
+
154
+ `Launchd.daemons()` gives the daemons of the `system` domain. Their job files are in `/Library/LaunchDaemons`. For the system domain, "root privileges are required to make modifications" (launchctl(1), lines 30-32). The package does not ask for root. A process that is not root gets `PermissionDeniedError`: from `launchctl` (exit code 1), or from the write of the job file (`EACCES` or `EPERM`). `install()` and `uninstall()` get it from their first bootout, before they write or remove anything.
155
+
156
+ ```ts
157
+ import { Launchd, PermissionDeniedError } from '@zukhruf/launchd';
158
+
159
+ const daemons = Launchd.daemons({ clock: globalThis });
160
+ try {
161
+ await daemons.install({
162
+ Label: 'com.example.backup',
163
+ Program: '/usr/local/libexec/backup',
164
+ UserName: '_backup',
165
+ StartCalendarInterval: { Hour: 3, Minute: 0 },
166
+ });
167
+ } catch (error) {
168
+ if (!(error instanceof PermissionDeniedError)) throw error;
169
+ console.error('Run this as root, or install an agent.');
170
+ }
171
+ ```
172
+
173
+ A daemon job can have `UserName`, `GroupName` and `InitGroups`. launchd applies them only in the system domain (launchd.plist(5), lines 74-83 and 333-337). An agent job can have `LimitLoadToSessionType`, which "only applies to jobs which are agents" (lines 104-107). The types `AgentJob` and `DaemonJob` hold this rule: `install()` of each domain takes only its own keys.
174
+
175
+ `state()` of a daemon needs no root: "Anyone may read or query the system domain" (launchctl(1), lines 30-31).
176
+
177
+ ## Write a job
178
+
179
+ A job is an object with the keys of launchd.plist(5), with Apple's names and value types ([ADR 0002](./docs/adr/0002-a-job-is-the-typed-launchd-plist-with-apples-key-names.md)). The type has each key that the page documents as live.
180
+
181
+ | To do this | Key |
182
+ | ----------------------------------------- | ---------------------------------------------------------------------------------- |
183
+ | Run a program | `Program`, `ProgramArguments`, `WorkingDirectory` |
184
+ | Give it its environment | `EnvironmentVariables` |
185
+ | Keep it running | `KeepAlive: true` |
186
+ | Start it again after a failure only | `KeepAlive: { SuccessfulExit: false }` |
187
+ | Start it again after a crash | `KeepAlive: { Crashed: true }` |
188
+ | Keep it running while a path exists | `KeepAlive: { PathState: { '/path/to/file': true } }` |
189
+ | Run it at load | `RunAtLoad: true` |
190
+ | Run it every N seconds | `StartInterval` |
191
+ | Run it at a time of day, a day or a month | `StartCalendarInterval` |
192
+ | Run it when a path changes | `WatchPaths` |
193
+ | Run it while a folder is not empty | `QueueDirectories` |
194
+ | Run it on a connection | `Sockets` |
195
+ | Run it on a device or a notification | `LaunchEvents` |
196
+ | Limit its resources | `ProcessType`, `SoftResourceLimits`, `HardResourceLimits`, `Nice`, `LowPriorityIO` |
197
+ | Keep its output | `StandardOutPath`, `StandardErrorPath` |
198
+ | Wait between two starts | `ThrottleInterval` |
199
+ | Give it time to stop | `ExitTimeOut` |
200
+
201
+ ```ts
202
+ import type { AgentJob } from '@zukhruf/launchd';
203
+
204
+ const nightly: AgentJob = {
205
+ Label: 'com.example.nightly',
206
+ ProgramArguments: ['/opt/homebrew/bin/node', '/Users/me/nightly/main.js'],
207
+ EnvironmentVariables: {
208
+ HOME: '/Users/me',
209
+ PATH: '/opt/homebrew/bin:/usr/bin:/bin',
210
+ },
211
+ StartCalendarInterval: [
212
+ { Hour: 3, Minute: 0 },
213
+ { Weekday: 0, Hour: 12, Minute: 30 },
214
+ ],
215
+ StandardOutPath: '/Users/me/Library/Logs/nightly.log',
216
+ StandardErrorPath: '/Users/me/Library/Logs/nightly.log',
217
+ ProcessType: 'Background',
218
+ };
219
+
220
+ const watcher: AgentJob = {
221
+ Label: 'com.example.watcher',
222
+ Program: '/usr/local/bin/watcher',
223
+ KeepAlive: {
224
+ SuccessfulExit: false,
225
+ PathState: { '/Users/me/.watcher-on': true },
226
+ },
227
+ ThrottleInterval: 30,
228
+ SoftResourceLimits: { NumberOfFiles: 4096 },
229
+ HardResourceLimits: { NumberOfFiles: 8192 },
230
+ };
231
+
232
+ const server: AgentJob = {
233
+ Label: 'com.example.server',
234
+ Program: '/usr/local/bin/server',
235
+ Sockets: {
236
+ Listeners: { SockNodeName: '127.0.0.1', SockServiceName: 8080 },
237
+ },
238
+ };
239
+ ```
240
+
241
+ - **Program.** `Program` is an absolute path: "The Program key must be an absolute path" (launchd.plist(5), lines 142-143). With no `Program`, item 0 of `ProgramArguments` is the program. It can be a name, but launchd finds a name in `/usr/bin:/bin:/usr/sbin:/sbin` (`_PATH_STDPATH`, lines 144-146), not in your `PATH`. A job has `Program`, a non-empty `ProgramArguments`, or both: then `ProgramArguments` is the whole argument vector, with its item 0 (lines 719-726).
242
+ - **Paths.** Each other key that takes a path takes an absolute path, `` `/${string}` ``. launchd expands no `~` and no `$HOME`.
243
+
244
+ A host that holds a resolved path string narrows it to `AbsolutePath` with `isAbsolutePath`:
245
+
246
+ ```ts
247
+ const root = resolve(directory);
248
+ if (!isAbsolutePath(root)) throw new Error(`${root} is not absolute`);
249
+ const watchPaths: AgentJob['WatchPaths'] = [root];
250
+ ```
251
+
252
+ - **KeepAlive.** "If multiple keys are provided, launchd ORs them" (lines 191-193). The watcher above starts again after a failure, and while the file exists.
253
+ - **Calendar intervals.** A missing field is a wildcard (lines 366-367). The fields are unions of their ranges: `Minute` 0-59, `Hour` 0-23, `Day` 1-31, `Weekday` 0-7 (0 and 7 are Sunday), `Month` 1-12. When the computer sleeps through an interval, launchd starts the job when it wakes, and starts it once for many missed intervals (lines 372-375). A `StartInterval` that falls in a sleep is missed (lines 357-362).
254
+ - **Sockets.** A socket has `SockPathName`, or `SecureSocketWithKey`, or the keys of a network socket, never keys of two forms. `SockPathMode` is decimal: "Property lists don't support octal" (lines 635-638). The program gets the sockets through `launch_activate_socket(3)` (lines 578-581).
255
+ - **Integers.** Each number key is an integer. The package renders a whole number as `<integer>`.
256
+
257
+ `LaunchEvents` takes the two event streams of xpc_events(3), "currently the only two supported event streams" (lines 29-34). The names of the events are yours. An IOKit event is a matching dictionary, and it must have `IOMatchLaunchStream: true` (lines 89-92). Its other keys are matching keys, such as `IOProviderClass`, and the properties that the device must have. A notification event names the notification that `notify_post(3)` posts. The example of xpc_events(3), lines 52-81:
258
+
259
+ ```ts
260
+ const onDevice: AgentJob = {
261
+ Label: 'com.example.on-device',
262
+ Program: '/usr/local/libexec/on-device',
263
+ LaunchEvents: {
264
+ 'com.apple.iokit.matching': {
265
+ 'Device was attached': {
266
+ IOMatchLaunchStream: true,
267
+ IOProviderClass: 'IOUSBDevice',
268
+ idVendor: 725,
269
+ idProduct: 2794,
270
+ },
271
+ },
272
+ 'com.apple.notifyd.matching': {
273
+ 'interesting-notification was posted': {
274
+ Notification: 'com.apple.interesting-notification',
275
+ },
276
+ },
277
+ },
278
+ };
279
+ ```
280
+
281
+ A job with `LaunchEvents` "MUST check in for the event with xpc_set_event_stream_handler() during its initialization" (xpc_events(3), lines 22-27), and a job with `MachServices` must check in for them (launchd.plist(5), lines 46-53). Node.js has no binding for these calls, so give these keys to a native program.
282
+
283
+ The type leaves out the keys that the page says are no longer supported, no longer implemented, or to remove: `LimitLoadToHosts`, `LimitLoadFromHosts`, `OnDemand` (use `KeepAlive`), `ServiceIPC`, `TimeOut`, `HopefullyExitsFirst`, `HopefullyExitsLast` and `NetworkState` of `KeepAlive`. It also leaves out `BundleProgram`, a key of SMAppService, and `Disabled`, which the override of `enable` replaces. [ADR 0002](./docs/adr/0002-a-job-is-the-typed-launchd-plist-with-apples-key-names.md) quotes the page for each.
284
+
285
+ ## Catch the errors that change what you do next
286
+
287
+ An error has its own class when a caller does something different after it ([ADR 0007](./docs/adr/0007-an-error-has-its-own-class-when-the-caller-handles-it-differently.md)). Each class comes from the exit code of `launchctl`, or from the error of Node.js.
288
+
289
+ | Class | When | What the caller does next |
290
+ | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
291
+ | `ServiceNotFoundError` | `kickstart()` or `kill()`, and launchctl exits 113 (Could not find specified service): the domain has no service with the label | Install the job, or bootstrap its job file |
292
+ | `PermissionDeniedError` | The write or the removal of the job file fails with `EACCES` or `EPERM`, or launchctl exits 1 (Operation not permitted). Daemons need root. | Run as root, or install an agent |
293
+ | `LaunchdUnavailableError` | `/bin/launchctl` does not start (`ENOENT`): this system is not macOS | Skip the work for launchd on this system |
294
+
295
+ Each class extends a base class, so a broad catch still works. `LaunchdError` is the base of every error of the package. `LaunchctlError` is the base of every answer of launchctl that is an error: it has `args`, `exitCode` and `stderr`. An exit code with no class of its own is a `LaunchctlError`. For example, a bootstrap that launchd refuses often exits 5 (Input/output error) with no reason, and stderr says "Try re-running the command as root for richer errors." A bootstrap of a disabled service exits 5 too, not 119 (Service is disabled), so a disabled service has no class of its own. `launchctl error <code>` decodes each code.
296
+
297
+ `PermissionDeniedError` comes from the file or from launchctl, so it extends `LaunchdError`. Its `cause` is the error of Node.js or the `LaunchctlError`. Another error of the file system, such as `ENOSPC`, stays the error of Node.js. A cancel rejects with the reason of the signal, as each cancel does ([the async glossary](../async/CONTEXT.md)).
298
+
299
+ Some answers of launchctl are not errors here:
300
+
301
+ | Call | Answer of launchctl | Result |
302
+ | --------------------------------------- | ------------------------------------ | ------------------------- |
303
+ | `state()` | 113 | `{ state: 'not loaded' }` |
304
+ | `bootout()`, `uninstall()`, `install()` | 0, or 36 (Operation now in progress) | the wait goes on |
305
+ | `bootout()`, `uninstall()`, `install()` | 3 (No such process) | the wait ends |
306
+
307
+ ```ts
308
+ import {
309
+ Launchd,
310
+ LaunchdUnavailableError,
311
+ ServiceNotFoundError,
312
+ } from '@zukhruf/launchd';
313
+
314
+ const launchd = Launchd.agents({ clock: globalThis });
315
+ const sync = launchd.service('com.example.sync');
316
+
317
+ const pid = await sync.kickstart().catch(async (error) => {
318
+ if (!(error instanceof ServiceNotFoundError)) throw error;
319
+ await launchd.install(job);
320
+ return sync.kickstart();
321
+ });
322
+
323
+ async function loaded(): Promise<boolean> {
324
+ try {
325
+ return (await sync.state()).state !== 'not loaded';
326
+ } catch (error) {
327
+ if (error instanceof LaunchdUnavailableError) return false;
328
+ throw error;
329
+ }
330
+ }
331
+ ```
332
+
333
+ ## What launchd does not do
334
+
335
+ - **It has no limit on restarts.** A `KeepAlive` job that exits starts again after `ThrottleInterval`, 10 seconds by default (launchd.plist(5), lines 325-328), forever. context-compiler found this (its backlog #4288). A program that must stop after many failures counts them itself. Or it uses `KeepAlive: { SuccessfulExit: false }`, and exits with status 0 to stop: launchd then does not start it again (lines 208-213).
336
+ - **A job does not inherit the environment of the program that installs it.** context-compiler found this (its backlog #4280). Give each variable in `EnvironmentVariables`. The job file has mode `0644`, and each user of the computer can read it, so do not put a secret in it.
337
+ - **It has no shell.** launchd gives `ProgramArguments` to execvp(3) (lines 136-140). It expands no `~`, no `$HOME` and no other variable, and it has no pipes. `EnableGlobbing` expands globs (lines 148-150). Thus each path in a job is absolute.
338
+ - **macOS charges file access to the program that the job runs.** "Daemons and agents managed by launchd are subject to macOS user privacy protections" (lines 692-696). A job that reads a protected folder needs Full Disk Access for its program, for example the `node` binary, not for the terminal app that installed it. context-compiler records this in `apps/cli/src/background-watch.ts:22-23`.
339
+
340
+ ## What the package does not do
341
+
342
+ - **It does not ask for root.** It runs no `sudo`, and no `osascript` with administrator privileges. Install a daemon from a process that is root already. No leading tool escalates: Homebrew prints "Try: sudo".
343
+ - **It does not grant privacy access** (TCC, Full Disk Access). Only the user grants it, in System Settings.
344
+ - **It does not use SMAppService.** SMAppService registers a job that is inside an app bundle (`Contents/Library/LaunchAgents`), and Node.js can call it only through a native binding ([ADR 0001](./docs/adr/0001-launchctl-is-the-interface-and-only-its-current-subcommands.md)). An app that installs a job file without SMAppService "should include this key with a value of the app's bundle identifier": `AssociatedBundleIdentifiers` (launchd.plist(5), lines 686-690).
345
+ - **It does not read logs.** launchd writes the output of the job to `StandardOutPath` and `StandardErrorPath`. Read those files.
346
+ - **It does not read a job file that it did not render.** It never parses a property list. `installed()` takes the labels from the file names. A program that inspects the job files of other programs reads them itself.
347
+
348
+ ## The same concepts in other systems
349
+
350
+ | Concept | Other systems |
351
+ | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
352
+ | A job with Apple's key names | `serviceConfig` of nix-darwin's `launchd.agents`, `launchd.daemons` and `launchd.user.agents`; the Rust crate koenichiwa/launchd |
353
+ | Install and load a job | `brew services start` (`cli.rb:529-573`); the activation of nix-darwin; Ansible's `community.general.launchd`; `Install` and `Start` of kardianos/service, with the option `UserService` for an agent; the `service` resource of Puppet with its launchd provider |
354
+ | The reconcile | nix-darwin reloads a job only when its rendered file differs from the installed file (`modules/system/launchd.nix:19,37`). Homebrew's `start` does nothing when the service runs. |
355
+ | The current subcommands | Only Homebrew (`cli.rb:465-473`). nix-darwin, Ansible, kardianos and Puppet use the legacy `load` and `unload`. |
356
+ | The wait after a bootout | Homebrew: `bootout` again every second, up to 60 seconds by default (`cli.rb:291-329`, `stop.rb:37`). Ansible sleeps 5 seconds, and kardianos 50 ms. |
357
+ | The state of one service | Homebrew reads `print` (`formula_wrapper.rb:498-525`). Ansible, kardianos and Puppet read `list`. |
358
+ | The domain of agents | Homebrew's `system.rb:94-117` |
359
+ | A job from an app bundle | SMAppService of the ServiceManagement framework |
360
+ | For orientation: systemd on Linux | A unit file in `~/.config/systemd/user/` or `/etc/systemd/system/` is a job file, and `systemctl --user` works in the domain of the user. `systemctl start`, `restart`, `kill` and `show` are near `kickstart`, `kickstart -k`, `kill` and `print`. `enable` differs: in systemd it makes a unit start at boot, and in launchd it only sets the override. systemd's `StartLimitBurst` stops a unit after many fast restarts; launchd has no such limit. |
361
+
362
+ ## API
363
+
364
+ ```ts
365
+ import type { Clock } from '@zukhruf/async';
366
+
367
+ /** The jobs of one domain, and the folder of their job files. */
368
+ export class Launchd<J extends AgentJob | DaemonJob> {
369
+ /** This user's agents: gui/<uid> when this uid owns /dev/console, else user/<uid>. The folder is Library/LaunchAgents under $HOME (ADR 0005). */
370
+ static agents(options: LaunchdOptions): Launchd<AgentJob>;
371
+ /** The daemons of the system domain, in /Library/LaunchDaemons. A change needs root. */
372
+ static daemons(options: LaunchdOptions): Launchd<DaemonJob>;
373
+
374
+ /** The domain-target: 'gui/501', 'user/501' or 'system'. */
375
+ readonly domain: Domain;
376
+ /** The absolute path of the folder of the job files. */
377
+ readonly folder: string;
378
+
379
+ /** The reconcile: writes <folder>/<Label>.plist when its bytes differ, boots out the old service, enables, bootstraps. */
380
+ install(job: J, options?: CancelOptions): Promise<Service>;
381
+ /** The handle of a label in this domain. Reads nothing and runs nothing. */
382
+ service(label: string): Service;
383
+ /** A handle for each <folder>/*.plist, with the label from the file name, sorted. No folder gives []. */
384
+ installed(options?: CancelOptions): Promise<Service[]>;
385
+ }
386
+
387
+ export interface LaunchdOptions {
388
+ /** The clock of the waits: the bootout wait and the atomic write. Production gives `globalThis`. */
389
+ clock: Clock;
390
+ }
391
+
392
+ export interface CancelOptions {
393
+ /** Cancels the wait. The call then rejects with `signal.reason`. */
394
+ signal?: AbortSignal;
395
+ }
396
+
397
+ /** A domain-target of launchctl(1). */
398
+ export type Domain = `gui/${number}` | `user/${number}` | 'system';
399
+
400
+ /** One label in one domain. A handle: it holds no state, and it exists also when launchd has no such service. */
401
+ export class Service {
402
+ readonly label: string;
403
+ /** The job file: <folder>/<label>.plist. */
404
+ readonly file: string;
405
+ /** The service-target: <domain>/<label>, such as 'gui/501/com.example.sync'. */
406
+ readonly target: string;
407
+
408
+ /** One `launchctl print <target>`: exit code 113 and the lines `pid =` and `last exit code =`. */
409
+ state(options?: CancelOptions): Promise<ServiceState>;
410
+ /** Runs the service now (`kickstart -p`). With `kill`, kills the process that runs first (`-k`). Gives the PID of the new process, or of the process that runs. */
411
+ kickstart(options?: CancelOptions & { kill?: boolean }): Promise<number>;
412
+ /** Sends a process signal, by name or number, to the process of the service. */
413
+ kill(
414
+ processSignal: NodeJS.Signals | number,
415
+ options?: CancelOptions,
416
+ ): Promise<void>;
417
+ /** Enables the service: launchd may load it again. */
418
+ enable(options?: CancelOptions): Promise<void>;
419
+ /** Disables the service: launchd does not load it until enable(), also after a restart. */
420
+ disable(options?: CancelOptions): Promise<void>;
421
+ /** Loads the job file into the domain. */
422
+ bootstrap(options?: CancelOptions): Promise<void>;
423
+ /** Removes the service from the domain, and waits until launchd forgets it. The job file stays. */
424
+ bootout(options?: CancelOptions): Promise<void>;
425
+ /** bootout(), then removes the job file. Resolves when neither is there. */
426
+ uninstall(options?: CancelOptions): Promise<void>;
427
+ }
428
+
429
+ /** What `launchctl print` shows of one service. */
430
+ export type ServiceState =
431
+ | { readonly state: 'not loaded' }
432
+ | {
433
+ readonly state: 'running';
434
+ readonly pid: number;
435
+ /** undefined: no number in a `last exit code` line, or no such line. */
436
+ readonly lastExitStatus: number | undefined;
437
+ }
438
+ | {
439
+ readonly state: 'not running';
440
+ readonly lastExitStatus: number | undefined;
441
+ };
442
+
443
+ /** An absolute path. launchd expands no `~` and no `$HOME`. */
444
+ export type AbsolutePath = `/${string}`;
445
+
446
+ /** Whether a path, such as one from `path.resolve()`, is an `AbsolutePath`, after `path.isAbsolute` of `node:path`. */
447
+ export function isAbsolutePath(path: string): path is AbsolutePath;
448
+
449
+ /** The keys of launchd.plist(5) that agents and daemons share: `Program`, or a non-empty `ProgramArguments`, or both. */
450
+ export type Job = {
451
+ /** Unique in the domain. The job file is <Label>.plist. */
452
+ Label: string;
453
+ inetdCompatibility?: { Wait?: boolean };
454
+ /** Keys of the "hw" sysctl(3) domain, such as model. */
455
+ LimitLoadToHardware?: Readonly<Record<string, readonly string[]>>;
456
+ LimitLoadFromHardware?: Readonly<Record<string, readonly string[]>>;
457
+ EnableGlobbing?: boolean;
458
+ EnableTransactions?: boolean;
459
+ EnablePressuredExit?: boolean;
460
+ KeepAlive?: boolean | KeepAliveConditions;
461
+ RunAtLoad?: boolean;
462
+ RootDirectory?: AbsolutePath;
463
+ WorkingDirectory?: AbsolutePath;
464
+ EnvironmentVariables?: Readonly<Record<string, string>>;
465
+ /** A decimal integer, or a string that strtoul(3) reads: '022' is octal. */
466
+ Umask?: number | string;
467
+ /** Seconds from SIGTERM to SIGKILL. 0 is infinity: do not use it. */
468
+ ExitTimeOut?: number;
469
+ /** Seconds between two starts. 10 by default. */
470
+ ThrottleInterval?: number;
471
+ WatchPaths?: readonly AbsolutePath[];
472
+ QueueDirectories?: readonly AbsolutePath[];
473
+ StartOnMount?: boolean;
474
+ /** Seconds. A start that falls in a sleep is missed. */
475
+ StartInterval?: number;
476
+ StartCalendarInterval?: CalendarInterval | readonly CalendarInterval[];
477
+ StandardInPath?: AbsolutePath;
478
+ StandardOutPath?: AbsolutePath;
479
+ StandardErrorPath?: AbsolutePath;
480
+ Debug?: boolean;
481
+ WaitForDebugger?: boolean;
482
+ SoftResourceLimits?: ResourceLimits;
483
+ HardResourceLimits?: ResourceLimits;
484
+ Nice?: number;
485
+ ProcessType?: 'Background' | 'Standard' | 'Adaptive' | 'Interactive';
486
+ AbandonProcessGroup?: boolean;
487
+ LowPriorityIO?: boolean;
488
+ LowPriorityBackgroundIO?: boolean;
489
+ MaterializeDatalessFiles?: boolean;
490
+ LaunchOnlyOnce?: boolean;
491
+ /** Each key is the name of a Mach service. The program must check in for it. */
492
+ MachServices?: Readonly<Record<string, true | MachService>>;
493
+ /** Each key is a name of your own for a socket or a group of sockets. */
494
+ Sockets?: Readonly<Record<string, Socket | readonly Socket[]>>;
495
+ LaunchEvents?: LaunchEvents;
496
+ SessionCreate?: boolean;
497
+ LegacyTimers?: boolean;
498
+ AssociatedBundleIdentifiers?: string | readonly string[];
499
+ } & (
500
+ | { Program: AbsolutePath; ProgramArguments?: readonly string[] }
501
+ | { Program?: never; ProgramArguments: readonly [string, ...string[]] }
502
+ );
503
+
504
+ /** A job for the agents of a user. */
505
+ export type AgentJob = Job & {
506
+ LimitLoadToSessionType?: SessionType | readonly SessionType[];
507
+ };
508
+
509
+ /** The session types of launchctl(1): Aqua is the default. */
510
+ export type SessionType = 'Aqua' | 'Background' | 'LoginWindow';
511
+
512
+ /** A job for the daemons of the system domain. */
513
+ export type DaemonJob = Job & {
514
+ UserName?: string;
515
+ /** Without it, the primary group of UserName. */
516
+ GroupName?: string;
517
+ /** true by default. Ignored without UserName. */
518
+ InitGroups?: boolean;
519
+ };
520
+
521
+ /** launchd ORs the conditions. */
522
+ export interface KeepAliveConditions {
523
+ /** Evaluates the other conditions only after the first launch for another reason. PathState is not affected. */
524
+ AfterInitialDemand?: boolean;
525
+ /** true: start again after exit status 0. false: start again after another exit status. */
526
+ SuccessfulExit?: boolean;
527
+ /** true keeps the job running while the path exists; false, while it does not. */
528
+ PathState?: Readonly<Record<AbsolutePath, boolean>>;
529
+ /** Each key is a label: true keeps the job running while that job is loaded. */
530
+ OtherJobEnabled?: Readonly<Record<string, boolean>>;
531
+ /** true: start again after a crash signal (SIGILL, SIGSEGV …). false: start again after another exit. */
532
+ Crashed?: boolean;
533
+ }
534
+
535
+ /** A missing field is a wildcard. When Day and Weekday are both set, either one matches. */
536
+ export interface CalendarInterval {
537
+ // The code lists each value of a range.
538
+ Minute?: 0 | 1 | 2 | /* … */ 59;
539
+ Hour?: 0 | 1 | 2 | /* … */ 23;
540
+ Day?: 1 | 2 | 3 | /* … */ 31;
541
+ /** 0 and 7 are Sunday. */
542
+ Weekday?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
543
+ Month?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
544
+ }
545
+
546
+ /** The limits of setrlimit(2), in bytes, seconds or counts. */
547
+ export interface ResourceLimits {
548
+ Core?: number;
549
+ CPU?: number;
550
+ Data?: number;
551
+ FileSize?: number;
552
+ MemoryLock?: number;
553
+ NumberOfFiles?: number;
554
+ NumberOfProcesses?: number;
555
+ ResidentSetSize?: number;
556
+ Stack?: number;
557
+ }
558
+
559
+ export interface MachService {
560
+ ResetAtClose?: boolean;
561
+ HideUntilCheckIn?: boolean;
562
+ }
563
+
564
+ /** One socket: a Unix domain socket at a path, a secure Unix domain socket, or a network socket. A form never takes the keys of another form (they are `?: never` in the code). */
565
+ export type Socket = {
566
+ SockType?: 'stream' | 'dgram' | 'seqpacket';
567
+ /** true (the default) listens; false connects. */
568
+ SockPassive?: boolean;
569
+ } & (
570
+ | {
571
+ SockPathName: AbsolutePath;
572
+ SockPathOwner?: number;
573
+ SockPathGroup?: number;
574
+ /** Decimal: property lists have no octal. */
575
+ SockPathMode?: number;
576
+ }
577
+ | {
578
+ /** The name of the environment variable that gets the path. */
579
+ SecureSocketWithKey: string;
580
+ SockPathOwner?: number;
581
+ SockPathGroup?: number;
582
+ SockPathMode?: number;
583
+ }
584
+ | {
585
+ SockNodeName?: string;
586
+ /** A port number, or a service name such as 'ssh'. */
587
+ SockServiceName?: string | number;
588
+ SockFamily?: 'IPv4' | 'IPv6' | 'IPv4v6';
589
+ SockProtocol?: 'TCP' | 'UDP';
590
+ Bonjour?: boolean | string | readonly string[];
591
+ MulticastGroup?: string;
592
+ }
593
+ );
594
+
595
+ /** The two event streams of xpc_events(3). The keys of a stream are event names of your own. */
596
+ export interface LaunchEvents {
597
+ 'com.apple.iokit.matching'?: Readonly<Record<string, MatchingDictionary>>;
598
+ 'com.apple.notifyd.matching'?: Readonly<
599
+ Record<string, { Notification: string }>
600
+ >;
601
+ }
602
+
603
+ /** An IOKit matching dictionary. Its other keys are the matching keys of IOKitKeys.h and the properties that the device must have, such as idVendor. */
604
+ export type MatchingDictionary = {
605
+ /** Required by xpc_events(3). launchd removes it before IOKit matches. */
606
+ IOMatchLaunchStream: true;
607
+ IOProviderClass?: string;
608
+ [key: string]: PropertyListValue;
609
+ };
610
+
611
+ /** A value of a property list that IOKit matches: a string, a number, a boolean, an array or a dictionary of these. */
612
+ export type PropertyListValue =
613
+ | string
614
+ | number
615
+ | boolean
616
+ | readonly PropertyListValue[]
617
+ | { readonly [key: string]: PropertyListValue };
618
+
619
+ /** The base of every error of the package. */
620
+ export class LaunchdError extends Error {}
621
+
622
+ /** launchctl exited with a code that is not 0. The base of every answer of launchctl that is an error. */
623
+ export class LaunchctlError extends LaunchdError {
624
+ /** The arguments after /bin/launchctl, such as ['kickstart', '-p', 'gui/501/com.example.sync']. */
625
+ readonly args: readonly string[];
626
+ /** `launchctl error <code>` decodes it. */
627
+ readonly exitCode: number;
628
+ readonly stderr: string;
629
+ }
630
+
631
+ /** launchctl exited 113 (Could not find specified service) for kickstart or kill. */
632
+ export class ServiceNotFoundError extends LaunchctlError {
633
+ readonly target: string;
634
+ }
635
+
636
+ /** EACCES or EPERM on the job file, or launchctl exit code 1. `cause` is the error of Node.js or the LaunchctlError. */
637
+ export class PermissionDeniedError extends LaunchdError {}
638
+
639
+ /** /bin/launchctl did not start (ENOENT): this system is not macOS. `cause` is the error of Node.js. */
640
+ export class LaunchdUnavailableError extends LaunchdError {}
641
+ ```
642
+
643
+ ## Each call and what it runs
644
+
645
+ Each `launchctl` below is `/bin/launchctl`, started with `execFile` and no shell. `<target>` is `<domain>/<label>`, and `<file>` is `<folder>/<label>.plist`.
646
+
647
+ | Call | What it runs |
648
+ | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
649
+ | `Launchd.agents()` | A stat of `/dev/console` for its owner, `os.userInfo()` for the uid, and `os.homedir()` (`$HOME`) for the folder |
650
+ | `Launchd.daemons()` | Nothing |
651
+ | `launchd.install(job)` | Render the job with `plist`, keys sorted; read `<file>`. The same bytes: `launchctl print <target>`; when it exits 113, `launchctl enable <target>` and `launchctl bootstrap <domain> <file>`. Other bytes or no file: `launchctl bootout <target>` every second until it exits 3; make `<folder>`; an atomic write of `<file>` with mode `0644`; `launchctl enable <target>`; `launchctl bootstrap <domain> <file>` |
652
+ | `launchd.service(label)` | Nothing |
653
+ | `launchd.installed()` | A read of the names in `<folder>` |
654
+ | `service.state()` | `launchctl print <target>` |
655
+ | `service.kickstart()` | `launchctl kickstart -p <target>`; with `kill`, `launchctl kickstart -k -p <target>` |
656
+ | `service.kill(sig)` | `launchctl kill <sig> <target>` |
657
+ | `service.enable()` | `launchctl enable <target>` |
658
+ | `service.disable()` | `launchctl disable <target>` |
659
+ | `service.bootstrap()` | `launchctl bootstrap <domain> <file>` |
660
+ | `service.bootout()` | `launchctl bootout <target>` every second until it exits 3 |
661
+ | `service.uninstall()` | As `bootout()`, then a removal of `<file>` that ignores a missing file |
662
+
663
+ ## What each repository changes
664
+
665
+ The package leads. Each repository below changes to fit it, with no adapter. Each change is a backlog item in that repository.
666
+
667
+ | Repository | Change | Backlog |
668
+ | --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
669
+ | context-compiler `apps/cli/src/background-watch.ts` | Done (abada22): `BackgroundWatch` runs on the package. `sync watch start` is `install()`, `sync watch restart` is `kickstart({ kill: true })` and `sync watch stop` is `uninstall()`; the hand-written `plutil` render and bootout loop are gone. The job file holds only `HOME`, because the Google client moved to `client_secret.json` (#4280). The end-to-end tests read `state()` and reuse fixed labels (#4467). | context-compiler #4441, #4280, #4467 |
670
+ | mac-cleanup `src/tasks/macos/launch-agents.ts` | Done (efa7a70): `assertNotLoaded` reads `launchd.service(label).state()` in place of `launchctl print` and its check of 113, and its advice names `service.target`. A label that is not one file name keeps its plist with a note. It still reads the job files of other programs itself. | mac-cleanup #4442 |
671
+ | agent-plugin | The nightly job of backlog #3821, with `StartCalendarInterval`, uses `install()` when it is built. | agent-plugin #3821 |