@mono-agent/agent-app 0.14.0 → 0.15.0
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.
- package/README.md +3 -7
- package/dist/app-config.d.ts.map +1 -1
- package/dist/app-config.js +3 -0
- package/dist/app-config.js.map +1 -1
- package/dist/app-controller-channels.d.ts +41 -7
- package/dist/app-controller-channels.d.ts.map +1 -1
- package/dist/app-controller-channels.js +2 -3
- package/dist/app-controller-channels.js.map +1 -1
- package/dist/app-controller-continuation.d.ts +43 -11
- package/dist/app-controller-continuation.d.ts.map +1 -1
- package/dist/app-controller-continuation.js.map +1 -1
- package/dist/app-controller-lifecycle.d.ts +34 -5
- package/dist/app-controller-lifecycle.d.ts.map +1 -1
- package/dist/app-controller-lifecycle.js.map +1 -1
- package/dist/app-controller-maintenance.d.ts +45 -8
- package/dist/app-controller-maintenance.d.ts.map +1 -1
- package/dist/app-controller-maintenance.js.map +1 -1
- package/dist/app-controller-memory-health.d.ts +39 -10
- package/dist/app-controller-memory-health.d.ts.map +1 -1
- package/dist/app-controller-memory-health.js.map +1 -1
- package/dist/app-controller-memory.d.ts +27 -5
- package/dist/app-controller-memory.d.ts.map +1 -1
- package/dist/app-controller-memory.js +0 -1
- package/dist/app-controller-memory.js.map +1 -1
- package/dist/app-controller-responder.d.ts +53 -7
- package/dist/app-controller-responder.d.ts.map +1 -1
- package/dist/app-controller-responder.js +1 -4
- package/dist/app-controller-responder.js.map +1 -1
- package/dist/app-controller-traceability.d.ts +63 -14
- package/dist/app-controller-traceability.d.ts.map +1 -1
- package/dist/app-controller-traceability.js.map +1 -1
- package/dist/app-controller-types.d.ts +63 -0
- package/dist/app-controller-types.d.ts.map +1 -0
- package/dist/app-controller-types.js +2 -0
- package/dist/app-controller-types.js.map +1 -0
- package/dist/app-controller-utils.d.ts +1 -1
- package/dist/app-controller-utils.d.ts.map +1 -1
- package/dist/app-controller.d.ts +5 -62
- package/dist/app-controller.d.ts.map +1 -1
- package/dist/app-controller.js +0 -6
- package/dist/app-controller.js.map +1 -1
- package/dist/background-lifecycle-utils.d.ts +27 -0
- package/dist/background-lifecycle-utils.d.ts.map +1 -0
- package/dist/background-lifecycle-utils.js +69 -0
- package/dist/background-lifecycle-utils.js.map +1 -0
- package/dist/background-log-maintenance.d.ts +6 -0
- package/dist/background-log-maintenance.d.ts.map +1 -0
- package/dist/background-log-maintenance.js +185 -0
- package/dist/background-log-maintenance.js.map +1 -0
- package/dist/background.d.ts +2 -4
- package/dist/background.d.ts.map +1 -1
- package/dist/background.js +3 -263
- package/dist/background.js.map +1 -1
- package/dist/channel-plugins.d.ts +2 -11
- package/dist/channel-plugins.d.ts.map +1 -1
- package/dist/channel-plugins.js +63 -60
- package/dist/channel-plugins.js.map +1 -1
- package/dist/channel-status-display.js +2 -6
- package/dist/channel-status-display.js.map +1 -1
- package/dist/channels.d.ts +5 -6
- package/dist/channels.d.ts.map +1 -1
- package/dist/channels.js +7 -5
- package/dist/channels.js.map +1 -1
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/cli-args.js +50 -0
- package/dist/cli-args.js.map +1 -1
- package/dist/cli-background-command.js +1 -1
- package/dist/cli-background-command.js.map +1 -1
- package/dist/cli-validate-config-command.d.ts.map +1 -1
- package/dist/cli-validate-config-command.js +12 -8
- package/dist/cli-validate-config-command.js.map +1 -1
- package/dist/config-reference.d.ts +4 -1
- package/dist/config-reference.d.ts.map +1 -1
- package/dist/config-reference.js +242 -65
- package/dist/config-reference.js.map +1 -1
- package/dist/configured-agent.d.ts +2 -8
- package/dist/configured-agent.d.ts.map +1 -1
- package/dist/configured-agent.js +3 -25
- package/dist/configured-agent.js.map +1 -1
- package/dist/consumer-contract.d.ts.map +1 -1
- package/dist/consumer-contract.js +2 -4
- package/dist/consumer-contract.js.map +1 -1
- package/dist/doctor-observability.d.ts +7 -0
- package/dist/doctor-observability.d.ts.map +1 -0
- package/dist/doctor-observability.js +80 -0
- package/dist/doctor-observability.js.map +1 -0
- package/dist/doctor-types.d.ts +17 -0
- package/dist/doctor-types.d.ts.map +1 -0
- package/dist/doctor-types.js +2 -0
- package/dist/doctor-types.js.map +1 -0
- package/dist/doctor.d.ts +2 -12
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +7 -106
- package/dist/doctor.js.map +1 -1
- package/dist/first-run-readiness.d.ts +1 -1
- package/dist/first-run-readiness.d.ts.map +1 -1
- package/dist/first-run-readiness.js +1 -1
- package/dist/first-run-readiness.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/managed-web-logs.d.ts +16 -0
- package/dist/managed-web-logs.d.ts.map +1 -0
- package/dist/managed-web-logs.js +153 -0
- package/dist/managed-web-logs.js.map +1 -0
- package/dist/posted-reply-history.d.ts.map +1 -1
- package/dist/posted-reply-history.js +3 -0
- package/dist/posted-reply-history.js.map +1 -1
- package/dist/web-command.d.ts +4 -1
- package/dist/web-command.d.ts.map +1 -1
- package/dist/web-command.js +31 -1
- package/dist/web-command.js.map +1 -1
- package/package.json +16 -16
- package/schema/mono-agent.config.schema.json +280 -162
- package/skills/mono-agent-composer/references/config-blueprint.md +4 -11
- package/skills/mono-agent-composer/references/discovery-questions.md +1 -1
- package/skills/mono-agent-composer/references/feature-coverage.md +4 -5
- package/skills/mono-agent-composer/references/package-map.md +4 -5
- package/skills/mono-agent-composer/references/playbooks.md +2 -2
- package/skills/mono-agent-composer/references/validation.md +1 -1
package/dist/background.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background.d.ts","sourceRoot":"","sources":["../src/background.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AA0BrE,OAAO,KAAK,EAEV,eAAe,EAEf,YAAY,EACb,M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CAqB1C;AAoCD,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,MAAM,GACX,IAAI,CAKN;AAiaD,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IACnD,QAAQ,CAAC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACjD,QAAQ,CAAC,wBAAwB,CAAC,EAAE,sBAAsB,CAAC;IAC3D,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,MAAM,CAAC;IACpC,qEAAqE;IACrE,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtD;AAED,wBAAsB,8BAA8B,CAClD,MAAM,EAAE,yBAAyB,EACjC,OAAO,GAAE,8BAAmC,GAC3C,OAAO,CAAC,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC,CAsD5C;AA6DD,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAmB9E"}
|
package/dist/background.js
CHANGED
|
@@ -19,6 +19,8 @@ import { acquireManagedRuntimePublicationBarrier } from "./managed-runtime-publi
|
|
|
19
19
|
import { processIncarnationFromJson, } from "./process-incarnation.js";
|
|
20
20
|
import { acquireOwnerPrivateLock, validateOwnerPrivateLockInputs } from "./owner-private-lock.js";
|
|
21
21
|
import { buildRunsHealthDisplay, RUNS_HEALTH_MAX_RUNS } from "./runs-health.js";
|
|
22
|
+
import { lifecycleFailure, maintenanceErrorMessage, pollUntil, uniquePids, unloadLaunchdService, } from "./background-lifecycle-utils.js";
|
|
23
|
+
import { maintainLaunchdLogsOperation, reportMaintenanceFailure, } from "./background-log-maintenance.js";
|
|
22
24
|
import * as ui from "./ui.js";
|
|
23
25
|
export { acquireBackgroundWorkerLease, backgroundWorkerLeasePath, } from "./background-worker-lease.js";
|
|
24
26
|
export { LAUNCHD_LOG_MAX_BYTES, LAUNCHD_LOG_ROTATION_COUNT, } from "./launchd-logs.js";
|
|
@@ -321,205 +323,7 @@ export async function forceRestartBackground(target, deps, whileStopped, poll) {
|
|
|
321
323
|
* its own durable lifecycle intent after a prior maintainer died post-bootout.
|
|
322
324
|
*/
|
|
323
325
|
export async function maintainLaunchdLogs(target, deps, poll = DEFAULT_CONTROL_POLL) {
|
|
324
|
-
|
|
325
|
-
if (release === undefined) {
|
|
326
|
-
// Controller start/restart/stop owns the same lock. Skipping this periodic
|
|
327
|
-
// pass is expected and avoids making launchd record a false maintenance
|
|
328
|
-
// failure; the next interval retries from a fresh inventory.
|
|
329
|
-
return 0;
|
|
330
|
-
}
|
|
331
|
-
try {
|
|
332
|
-
const uid = deps.getuid();
|
|
333
|
-
const service = await launchdServiceInfo(deps.runner, target.label, uid);
|
|
334
|
-
let inspection;
|
|
335
|
-
try {
|
|
336
|
-
inspection = await deps.inspectLaunchdLogs(target.paths);
|
|
337
|
-
}
|
|
338
|
-
catch (error) {
|
|
339
|
-
reportMaintenanceFailure(target, deps, "inspect launchd logs", error);
|
|
340
|
-
return 1;
|
|
341
|
-
}
|
|
342
|
-
let maintenanceIntent;
|
|
343
|
-
try {
|
|
344
|
-
maintenanceIntent = await deps.readLaunchdLogMaintenanceIntent(target.paths);
|
|
345
|
-
}
|
|
346
|
-
catch (error) {
|
|
347
|
-
reportMaintenanceFailure(target, deps, "read durable launchd-log maintenance intent", error);
|
|
348
|
-
return 1;
|
|
349
|
-
}
|
|
350
|
-
if (inspection.pendingMaintenance && maintenanceIntent === undefined) {
|
|
351
|
-
reportMaintenanceFailure(target, deps, "read durable launchd-log maintenance intent", new Error("The maintenance marker disappeared after inventory."));
|
|
352
|
-
return 1;
|
|
353
|
-
}
|
|
354
|
-
if (!service.loaded && maintenanceIntent === undefined)
|
|
355
|
-
return 0;
|
|
356
|
-
let originalPlistIdentity;
|
|
357
|
-
try {
|
|
358
|
-
originalPlistIdentity = await deps.verifyLaunchdPlist(target.paths.plistPath);
|
|
359
|
-
}
|
|
360
|
-
catch (error) {
|
|
361
|
-
reportMaintenanceFailure(target, deps, "verify the existing main LaunchAgent", error);
|
|
362
|
-
return 1;
|
|
363
|
-
}
|
|
364
|
-
if (maintenanceIntent !== undefined
|
|
365
|
-
&& (maintenanceIntent.label !== target.label
|
|
366
|
-
|| maintenanceIntent.plistFingerprint !== originalPlistIdentity)) {
|
|
367
|
-
reportMaintenanceFailure(target, deps, "authenticate durable launchd-log maintenance intent", new Error("The pending intent does not match the exact main LaunchAgent definition."));
|
|
368
|
-
return 1;
|
|
369
|
-
}
|
|
370
|
-
if (maintenanceIntent?.phase === "stopping" && !service.loaded) {
|
|
371
|
-
reportMaintenanceFailure(target, deps, "recover interrupted launchd-log maintenance", new Error("The prior maintainer did not durably prove every old writer PID dead; refusing rotation."));
|
|
372
|
-
return 1;
|
|
373
|
-
}
|
|
374
|
-
if (maintenanceIntent?.phase === "restoring") {
|
|
375
|
-
const replacement = await launchdServiceInfo(deps.runner, target.label, uid);
|
|
376
|
-
if (!replacement.loaded || replacement.pid === undefined || !deps.isAlive(replacement.pid)) {
|
|
377
|
-
reportMaintenanceFailure(target, deps, "recover interrupted launchd-log restoration", new Error("The replacement writer identity was lost before live-worker proof; refusing stale rotation authority."));
|
|
378
|
-
return 1;
|
|
379
|
-
}
|
|
380
|
-
try {
|
|
381
|
-
await deps.clearLaunchdLogMaintenanceIntent(target.paths, maintenanceIntent);
|
|
382
|
-
}
|
|
383
|
-
catch (error) {
|
|
384
|
-
reportMaintenanceFailure(target, deps, "clear recovered launchd-log restoration intent", error);
|
|
385
|
-
return 1;
|
|
386
|
-
}
|
|
387
|
-
return 0;
|
|
388
|
-
}
|
|
389
|
-
if (maintenanceIntent?.phase === "stopped" && service.loaded) {
|
|
390
|
-
reportMaintenanceFailure(target, deps, "recover interrupted launchd-log maintenance", new Error("launchd reports a writer loaded after durable stopped-writer proof; refusing rotation."));
|
|
391
|
-
return 1;
|
|
392
|
-
}
|
|
393
|
-
if (!inspection.canMaintain) {
|
|
394
|
-
deps.stderr(ui.errorLine(`Scheduled log maintenance refused unsafe paths for ${target.label}.`));
|
|
395
|
-
for (const issue of inspection.issues)
|
|
396
|
-
deps.stderr(ui.style.dim(issue) + "\n");
|
|
397
|
-
return 1;
|
|
398
|
-
}
|
|
399
|
-
if (!inspection.needsMaintenance && maintenanceIntent === undefined)
|
|
400
|
-
return 0;
|
|
401
|
-
if (maintenanceIntent === undefined) {
|
|
402
|
-
maintenanceIntent = {
|
|
403
|
-
version: 1,
|
|
404
|
-
phase: "stopping",
|
|
405
|
-
label: target.label,
|
|
406
|
-
plistFingerprint: originalPlistIdentity,
|
|
407
|
-
};
|
|
408
|
-
try {
|
|
409
|
-
await deps.beginLaunchdLogMaintenanceIntent(target.paths, maintenanceIntent);
|
|
410
|
-
}
|
|
411
|
-
catch (error) {
|
|
412
|
-
reportMaintenanceFailure(target, deps, "publish durable launchd-log maintenance intent", error);
|
|
413
|
-
return 1;
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
if (maintenanceIntent.phase === "stopping") {
|
|
417
|
-
const stopped = await unloadLaunchdService(target.label, service, uniquePids([service.pid]), deps, uid, poll);
|
|
418
|
-
if (!stopped.ok) {
|
|
419
|
-
reportMaintenanceFailure(target, deps, "prove the launchd log writer stopped", stopped.failure);
|
|
420
|
-
return 1;
|
|
421
|
-
}
|
|
422
|
-
try {
|
|
423
|
-
maintenanceIntent = await deps.markLaunchdLogMaintenanceStopped(target.paths, maintenanceIntent);
|
|
424
|
-
}
|
|
425
|
-
catch (error) {
|
|
426
|
-
reportMaintenanceFailure(target, deps, "record durable stopped-writer proof", error);
|
|
427
|
-
return 1;
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
else {
|
|
431
|
-
const current = await launchdServiceInfo(deps.runner, target.label, uid);
|
|
432
|
-
if (current.loaded || (current.pid !== undefined && deps.isAlive(current.pid))) {
|
|
433
|
-
reportMaintenanceFailure(target, deps, "recheck durable stopped-writer proof", new Error("launchd exposed a live writer before recovered rotation."));
|
|
434
|
-
return 1;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
try {
|
|
438
|
-
await deps.rotateStoppedLaunchdLogs(target.paths);
|
|
439
|
-
// Close the pathname-replacement race before handing the definition to
|
|
440
|
-
// launchctl. A changed/symlinked plist leaves the worker stopped.
|
|
441
|
-
const currentPlistIdentity = await deps.verifyLaunchdPlist(target.paths.plistPath);
|
|
442
|
-
if (currentPlistIdentity !== originalPlistIdentity) {
|
|
443
|
-
throw new Error("The main LaunchAgent plist changed during stopped-writer maintenance.");
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
catch (error) {
|
|
447
|
-
reportMaintenanceFailure(target, deps, "commit bounded stopped-writer logs", error);
|
|
448
|
-
return 1;
|
|
449
|
-
}
|
|
450
|
-
try {
|
|
451
|
-
maintenanceIntent = await deps.markLaunchdLogMaintenanceRestoring(target.paths, maintenanceIntent);
|
|
452
|
-
}
|
|
453
|
-
catch (error) {
|
|
454
|
-
reportMaintenanceFailure(target, deps, "invalidate stopped-writer proof before restoration", error);
|
|
455
|
-
return 1;
|
|
456
|
-
}
|
|
457
|
-
const booted = await bootstrap(deps.runner, target.paths.plistPath, uid);
|
|
458
|
-
const observedRestorePids = new Set();
|
|
459
|
-
const running = await pollUntil(deps, poll, async () => {
|
|
460
|
-
const current = await launchdServiceInfo(deps.runner, target.label, uid);
|
|
461
|
-
if (current.pid !== undefined)
|
|
462
|
-
observedRestorePids.add(current.pid);
|
|
463
|
-
return current.loaded && current.pid !== undefined && deps.isAlive(current.pid);
|
|
464
|
-
});
|
|
465
|
-
if (!running) {
|
|
466
|
-
const current = await launchdServiceInfo(deps.runner, target.label, uid);
|
|
467
|
-
if (current.pid !== undefined)
|
|
468
|
-
observedRestorePids.add(current.pid);
|
|
469
|
-
const cleanedUp = await unloadLaunchdService(target.label, current, [...observedRestorePids], deps, uid, poll);
|
|
470
|
-
reportMaintenanceFailure(target, deps, "restore the exact main LaunchAgent after rotation", lifecycleFailure(booted, "launchd did not expose a live replacement worker"));
|
|
471
|
-
if (!cleanedUp.ok) {
|
|
472
|
-
reportMaintenanceFailure(target, deps, "remove the failed replacement worker", cleanedUp.failure);
|
|
473
|
-
}
|
|
474
|
-
return 1;
|
|
475
|
-
}
|
|
476
|
-
try {
|
|
477
|
-
const restoredPlistIdentity = await deps.verifyLaunchdPlist(target.paths.plistPath);
|
|
478
|
-
if (restoredPlistIdentity !== originalPlistIdentity) {
|
|
479
|
-
throw new Error("The main LaunchAgent plist changed while launchd restored the worker.");
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
catch (error) {
|
|
483
|
-
const restoredService = await launchdServiceInfo(deps.runner, target.label, uid);
|
|
484
|
-
const stoppedAgain = await unloadLaunchdService(target.label, restoredService, uniquePids([restoredService.pid, ...observedRestorePids]), deps, uid, poll);
|
|
485
|
-
reportMaintenanceFailure(target, deps, "prove the restored main LaunchAgent definition", error);
|
|
486
|
-
if (!stoppedAgain.ok) {
|
|
487
|
-
reportMaintenanceFailure(target, deps, "stop the worker after its definition changed", stoppedAgain.failure);
|
|
488
|
-
}
|
|
489
|
-
return 1;
|
|
490
|
-
}
|
|
491
|
-
try {
|
|
492
|
-
await deps.clearLaunchdLogMaintenanceIntent(target.paths, maintenanceIntent);
|
|
493
|
-
}
|
|
494
|
-
catch (error) {
|
|
495
|
-
reportMaintenanceFailure(target, deps, "clear durable launchd-log maintenance intent", error);
|
|
496
|
-
return 1;
|
|
497
|
-
}
|
|
498
|
-
return 0;
|
|
499
|
-
}
|
|
500
|
-
finally {
|
|
501
|
-
await release().catch((error) => {
|
|
502
|
-
deps.stderr(ui.errorLine(`Could not release lifecycle lock for ${target.label}: ${error instanceof Error ? error.message : String(error)}`));
|
|
503
|
-
});
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
function reportMaintenanceFailure(target, deps, action, error) {
|
|
507
|
-
deps.stderr(ui.errorLine(`Scheduled log maintenance could not ${action} for ${target.label}: ${maintenanceErrorMessage(error)}`));
|
|
508
|
-
}
|
|
509
|
-
function maintenanceErrorMessage(error) {
|
|
510
|
-
if (error instanceof Error)
|
|
511
|
-
return error.message;
|
|
512
|
-
if (typeof error === "object" && error !== null) {
|
|
513
|
-
const result = error;
|
|
514
|
-
const detail = [result.stderr, result.stdout]
|
|
515
|
-
.find((value) => typeof value === "string" && value.trim().length > 0)
|
|
516
|
-
?.trim();
|
|
517
|
-
if (detail !== undefined)
|
|
518
|
-
return detail;
|
|
519
|
-
if (typeof result.code === "number")
|
|
520
|
-
return `launchctl exited ${result.code}`;
|
|
521
|
-
}
|
|
522
|
-
return String(error);
|
|
326
|
+
return await maintainLaunchdLogsOperation(target, deps, poll);
|
|
523
327
|
}
|
|
524
328
|
/**
|
|
525
329
|
* Ensure the canonical per-config LaunchAgent is running and return the fresh
|
|
@@ -1032,50 +836,6 @@ async function bootstrapOrRestart(target, deps, uid, poll, beforeMainBootout, wh
|
|
|
1032
836
|
: `main service did not load; scheduled maintenance cleanup failed: ${maintenanceErrorMessage(maintenanceRemoval.failure)}`),
|
|
1033
837
|
};
|
|
1034
838
|
}
|
|
1035
|
-
async function unloadLaunchdService(label, service, ownedPids, deps, uid, poll, beforeLoadedBootout) {
|
|
1036
|
-
const observedPids = new Set(uniquePids([service.pid, ...ownedPids]));
|
|
1037
|
-
try {
|
|
1038
|
-
await beforeLoadedBootout?.();
|
|
1039
|
-
}
|
|
1040
|
-
catch (error) {
|
|
1041
|
-
return {
|
|
1042
|
-
ok: false,
|
|
1043
|
-
failure: { code: 1, stdout: "", stderr: maintenanceErrorMessage(error) },
|
|
1044
|
-
};
|
|
1045
|
-
}
|
|
1046
|
-
// Refresh immediately before bootout. The caller may have spent time on
|
|
1047
|
-
// inventory or plist verification while KeepAlive replaced its entry PID.
|
|
1048
|
-
let current = await launchdServiceInfo(deps.runner, label, uid);
|
|
1049
|
-
if (current.pid !== undefined)
|
|
1050
|
-
observedPids.add(current.pid);
|
|
1051
|
-
let removed;
|
|
1052
|
-
if (current.loaded) {
|
|
1053
|
-
removed = await bootout(deps.runner, label, uid);
|
|
1054
|
-
}
|
|
1055
|
-
else {
|
|
1056
|
-
removed = { code: 0, stdout: "", stderr: "" };
|
|
1057
|
-
}
|
|
1058
|
-
// Keep launchd state and process liveness in one predicate. In particular,
|
|
1059
|
-
// retain every KeepAlive replacement pid exposed while bootout converges;
|
|
1060
|
-
// proving only the entry snapshot dead is not a stopped-writer proof.
|
|
1061
|
-
const stopped = await pollUntil(deps, poll, async () => {
|
|
1062
|
-
current = await launchdServiceInfo(deps.runner, label, uid);
|
|
1063
|
-
if (current.pid !== undefined)
|
|
1064
|
-
observedPids.add(current.pid);
|
|
1065
|
-
return !current.loaded && [...observedPids].every((pid) => !deps.isAlive(pid));
|
|
1066
|
-
});
|
|
1067
|
-
if (!stopped) {
|
|
1068
|
-
const livePids = [...observedPids].filter((pid) => deps.isAlive(pid));
|
|
1069
|
-
const detail = current.loaded
|
|
1070
|
-
? `launchd still reports ${label} loaded after bootout`
|
|
1071
|
-
: `${label} pid(s) ${livePids.join(", ")} remained alive after bootout`;
|
|
1072
|
-
return {
|
|
1073
|
-
ok: false,
|
|
1074
|
-
failure: lifecycleFailure(removed, detail),
|
|
1075
|
-
};
|
|
1076
|
-
}
|
|
1077
|
-
return { ok: true };
|
|
1078
|
-
}
|
|
1079
839
|
function maintenancePathsForTarget(target) {
|
|
1080
840
|
const label = deriveLaunchdMaintenanceLabel(target.label);
|
|
1081
841
|
return { label, plistPath: resolve(target.paths.launchAgentsDir, `${label}.plist`) };
|
|
@@ -1106,26 +866,6 @@ async function findOwnershipConflict(target, deps, uid) {
|
|
|
1106
866
|
}
|
|
1107
867
|
return undefined;
|
|
1108
868
|
}
|
|
1109
|
-
async function pollUntil(deps, options, condition) {
|
|
1110
|
-
const deadline = deps.now() + options.timeoutMs;
|
|
1111
|
-
for (;;) {
|
|
1112
|
-
if (await condition())
|
|
1113
|
-
return true;
|
|
1114
|
-
if (deps.now() >= deadline)
|
|
1115
|
-
return false;
|
|
1116
|
-
await deps.sleep(options.intervalMs);
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
function lifecycleFailure(result, detail) {
|
|
1120
|
-
return {
|
|
1121
|
-
code: result.code === 0 ? 1 : result.code,
|
|
1122
|
-
stdout: result.stdout,
|
|
1123
|
-
stderr: [result.stderr.trim(), detail].filter((value) => value.length > 0).join("\n"),
|
|
1124
|
-
};
|
|
1125
|
-
}
|
|
1126
|
-
function uniquePids(values) {
|
|
1127
|
-
return [...new Set(values.filter((value) => value !== undefined && value > 0))];
|
|
1128
|
-
}
|
|
1129
869
|
export async function stopBackground(target, deps, poll = DEFAULT_CONTROL_POLL) {
|
|
1130
870
|
const release = await deps.acquireLifecycleLock(target);
|
|
1131
871
|
if (release === undefined) {
|