pub struct InstallRequest { /* private fields */ }Expand description
What service install was asked for, before anything has been resolved.
Separate from InstallPlan because a request is the operator’s words and
a plan is what the host actually supports: the plan carries a resolved
absolute binary path, the account the start mode obliges, and the four
directories the registration is installed against, none of which the caller
supplies.
Implementations§
Source§impl InstallRequest
impl InstallRequest
Sourcepub const fn started_on_demand(self) -> Self
pub const fn started_on_demand(self) -> Self
Registers the service but does not ask the manager to start it by itself.
Production never uses this: a boot-mode registration that does not start
at boot is the failure service status reports. The privileged
installer tests use it for every fixture they create, so that a
registration which somehow escaped its cleanup guard cannot start with
the owner’s machine on the next reboot. A leaked service is bad; a
leaked service that runs is worse, and the difference costs one flag.
Sourcepub fn for_binary(self, binary: impl Into<PathBuf>) -> Self
pub fn for_binary(self, binary: impl Into<PathBuf>) -> Self
Register a named binary instead of the running one.
The privileged installer tests use this to register a fixture service
host. Production does not: 05-infrastructure.md item 6 is specifically
about the path of the running binary, and letting an operator name a
different one would defeat the stale-path detection it asks for.
Sourcepub fn copied_from(self, source: impl Into<PathBuf>) -> Self
pub fn copied_from(self, source: impl Into<PathBuf>) -> Self
Where the registered binary was copied from.
§Why a registration has a source at all
A service registered directly against a package manager’s own file can
never be upgraded on Windows, because the running service holds that
file open and npm i -g cannot replace it. What it does instead is
worse than failing: it rewrites the package metadata, reports success,
and leaves the old executable in place — so the operator is told the new
version is installed while the old one keeps running. That was observed,
twice in a row, before this existed.
So the service runs a copy the product owns, and this records where that
copy came from. The source is what a package manager updates, what
inspect_binary watches for item 6’s stale-path case, and what the
daemon compares its own version against to know an upgrade is waiting.
Sourcepub fn with_arguments<I, S>(self, arguments: I) -> Self
pub fn with_arguments<I, S>(self, arguments: I) -> Self
Replace the registered arguments. Defaults to DAEMON_ARGUMENTS.
Sourcepub const fn with_restart(self, restart: RestartPolicy) -> Self
pub const fn with_restart(self, restart: RestartPolicy) -> Self
Replace the restart-on-failure policy. Defaults to
RestartPolicy::default.
Sourcepub const fn start_mode(&self) -> StartMode
pub const fn start_mode(&self) -> StartMode
The start mode asked for.
Trait Implementations§
Source§impl Clone for InstallRequest
impl Clone for InstallRequest
Source§fn clone(&self) -> InstallRequest
fn clone(&self) -> InstallRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more