pub struct DefinitionDrift {
pub path: PathBuf,
pub installed_by_version: String,
pub rendered: String,
pub start_mode: StartMode,
pub manager: DefinitionKind,
pub writable: Vec<PathBuf>,
}Expand description
An installed service definition that differs from what this build renders for the same recorded installation.
§Why this exists
An upgrade replaces the binary a registration runs and nothing else. A
systemd unit written by 0.4.7 still carried LoadCredential=, which hands
the daemon a copy of the credential frozen at service start, and lacked
write access to the credential store. Every release after the fix kept
running under that unit: the daemon could neither renew the token nor see
one renewed by anybody else, and stopped starting runners the moment the
frozen access token expired.
Fields§
§path: PathBufThe definition file on disk.
installed_by_version: StringThe build that wrote it, as its install record says.
rendered: StringWhat this build renders in its place.
start_mode: StartModeThe start mode it was installed for.
manager: DefinitionKindWhich manager reads the definition.
writable: Vec<PathBuf>The directories the rendered definition lets the service write. A
systemd unit fails before its first instruction (226/NAMESPACE) when
one it lists is missing, or is under a home tree its
ProtectHome=tmpfs hides without a BindPaths= for it. So whoever
writes rendered creates them first: a host an older build installed
may never have made one.
Implementations§
Source§impl DefinitionDrift
impl DefinitionDrift
Sourcepub fn create_writable(&self) -> Result<()>
pub fn create_writable(&self) -> Result<()>
Creates every missing directory in Self::writable: the directory
itself 0700, its parents (~/.local and its like, not this
program’s to tighten) as the umask says.
§Errors
The first directory that could not be created.