Skip to main content

Crate eggup_service

Crate eggup_service 

Source
Expand description

Manager-neutral service registration, ownership, and lifecycle model plus Unix manager mechanics and a native Windows SCM adapter.

Destructive manager operations are authorized only for Owned registrations. Foreign and Unknown fail closed. Manager state and application health are separate. No privilege escalation, no updater or transport policy, and no shell interpolation live in this crate.

Structs§

CommitEnginePolicy
The two named, separately testable inputs that distinguish the unified engine’s behaviour.
CronManager
Cron manager: a managed block inside the user’s crontab.
DirectObservation
Caller-supplied selected direct-runtime observation.
DispositionBaseline
Baseline authority/state observed after preparation.
FakeCall
One observed call for FakeExecutor.
FakeExecutor
Deterministic test executor with scripted responses.
HostFacts
Observed host facts (separate from selection policy).
LaunchdInstall
Caller-owned launchd install material.
LaunchdManager
launchd manager implementing the neutral contract.
LifecycleFailure
Bounded service-specific failure evidence, separate from Core artifact evidence.
LifecycleSnapshot
A point-in-time lifecycle observation plus desired restoration intent.
LifecycleUpdatePolicy
Mechanism-level choices and bounds for one service-aware transaction.
LifecycleUpdateReceipt
Composite result that retains the exact Core transaction evidence.
ManagerCommandOutput
Bounded output of one manager command invocation.
NoPostInstallCheck
No-op check for consumers that require lifecycle restoration only.
NoProbe
Null probe: health is always unknown.
PostInstallCheckError
Bounded caller-owned post-install check failure.
RegistrationSnapshot
A manager-neutral registration observation.
ServiceId
A validated opaque service identity (unit name, launchd label, SCM name).
ServiceSpec
Consumer-supplied desired registration.
SystemExecutor
Production bounded command runner (literal argv, no shell).
SystemdInstall
Caller-owned systemd install material (mechanics only, no product policy).
SystemdManager
systemd manager implementing the neutral contract.
TestDoubleManager
Deterministic in-memory manager for contract tests.
TransitionResult
Bounded transition outcome with conflict diagnostics.
UnixPlannerInput
Unix-like planner inputs.
WindowsPlannerInput
Windows-like planner inputs.
WindowsScmInstall
Caller-owned settings used when creating or refreshing an SCM registration.
WindowsScmManager
Native Windows SCM adapter implementing the manager-neutral contract.

Enums§

CandidateManager
Candidate manager families for auto-selection (policy helper output).
DirectState
Selected direct-runtime state.
HealthState
Application health, distinct from manager state.
KnownConfig
Known vs unknown registered config identity for Unix-like planning.
LaunchdDomain
launchd domain without automatic EUID-based choice.
LifecycleRestorationStatus
Terminal service restoration status for a composite update.
LifecycleState
Manager-neutral lifecycle state. Health is separate.
LifecycleUpdateError
Failure before a composite terminal transaction receipt could be returned.
LifecycleUpdatePhase
Phase that produced lifecycle-specific update evidence.
ManagerFailureKind
Machine-readable classification of a manager failure.
Ownership
Canonical ownership classification, re-exported from eggup-core.
OwnershipLossTolerance
Whether ownership loss during a transition is tolerated.
PostTransitionVerification
Whether the engine re-inspects the manager after a transition.
RestoreIntent
Desired post-update restoration.
ServiceError
Typed service errors. Destructive attempts on Foreign/Unknown fail here. Error strings produced by crate helpers are capped at MAX_DIAGNOSTIC_BYTES UTF-8-safe bytes.
ServiceOperation
Manager operations. Destructive variants require Owned.
SystemdScope
systemd scope without privilege guessing.
UpdateRuntimeDisposition
Product-neutral update runtime disposition.
WindowsErrorControl
Caller-selected SCM error-control setting.
WindowsServiceDependency
A caller-selected SCM dependency by service key or load-order group.
WindowsServiceState
Windows SCM state classes.
WindowsStartType
Caller-selected Windows service startup mode.

Constants§

MAX_COMMAND_OUTPUT_BYTES
Maximum captured bytes per stdout/stderr stream for one manager call.
MAX_CRONTAB_BYTES
Maximum crontab content accepted for list/install (fail closed above).
MAX_DEFINITION_BYTES
Maximum service definition bytes accepted for atomic writes.
MAX_DIAGNOSTIC_BYTES
The one byte ceiling for diagnostic text produced by this crate.
MAX_TRANSITION_TIMEOUT
Upper bound for transition polling (callers supply smaller values).

Traits§

CommandExecutor
Injectable manager-command executor (literal argv, no shell).
DirectRuntimeControl
Minimum caller-owned direct-runtime control seam.
HealthProbe
Consumer-supplied health probe. Read-only: never mutates manager state.
PostInstallCheck
Caller-controlled post-install check. Implementations must honor remaining.
ServiceManager
Manager-neutral service operations. Platform adapters implement this in later milestones; TestDoubleManager implements it for tests.

Functions§

atomic_write_definition
Atomically writes a manager definition file.
candidate_managers
Small explicit auto-selection policy over HostFacts.
commit_with_disposition
Disposition-aware orchestration over an existing ValidatedTransaction.
commit_with_disposition_with_engine_policy
Disposition-aware orchestration under an explicitly selected commit-engine policy.
commit_with_lifecycle
Quiesce an owned service, compose Core M007, and restore lifecycle state based on the artifact result.
commit_with_lifecycle_with_engine_policy
Quiesce an owned service under an explicitly selected commit-engine policy.
cron_classify
Classifies a crontab against one desired block.
cron_merge
Merges one managed block idempotently, preserving unrelated bytes.
cron_remove
Removes the owned managed block, preserving unrelated bytes.
inspect_host
Inspects host manager facts without choosing policy.
plan_unix
Pure Unix-like manager/direct decision logic.
plan_windows
Pure Windows SCM/executable decision logic including pending states.
require_owned
Ownership guard shared by all destructive operations.

Type Aliases§

CommandOutput
Compatibility alias for the former CommandOutput name.
CronOwnership
How a crontab relates to one managed block.