pub struct SystemdInstall {
pub unit_name: String,
pub scope: SystemdScope,
pub unit_path: PathBuf,
pub definition: Vec<u8>,
pub enable: bool,
pub reload: bool,
pub transition_timeout: Duration,
}Expand description
Caller-owned systemd install material (mechanics only, no product policy).
Fields§
§unit_name: StringUnit name (for example my-daemon.service). *.service only.
scope: SystemdScopeExplicit scope (never guessed from EUID).
unit_path: PathBufAbsolute unit file path supplied by the caller.
definition: Vec<u8>Exact desired unit file bytes (caller-owned content).
enable: boolWhether to run enable after install/refresh (explicit only).
reload: boolWhether to run daemon-reload after install/refresh (explicit only).
transition_timeout: DurationBounded wait for state transitions.
Implementations§
Source§impl SystemdInstall
impl SystemdInstall
Sourcepub fn new(
unit_name: String,
scope: SystemdScope,
unit_path: PathBuf,
definition: Vec<u8>,
enable: bool,
reload: bool,
transition_timeout: Duration,
) -> Result<Self, ServiceError>
pub fn new( unit_name: String, scope: SystemdScope, unit_path: PathBuf, definition: Vec<u8>, enable: bool, reload: bool, transition_timeout: Duration, ) -> Result<Self, ServiceError>
Validates install material without touching the manager.
§Errors
ServiceError::InvalidInput when the unit name is empty, overlong,
contains a control character, is not a bare *.service file name, when
the unit path is not absolute, when the definition bytes are empty,
overlong, or contain a NUL byte, or when the transition timeout is zero
or above MAX_TRANSITION_TIMEOUT.