pub struct Systemd {
txn_dir: PathBuf,
}Fields§
§txn_dir: PathBufImplementations§
Trait Implementations§
Source§impl UnitBackend for Systemd
impl UnitBackend for Systemd
Source§fn protecting(&self, tools: &[UnitId]) -> Result<BTreeSet<UnitId>, Outcome>
fn protecting(&self, tools: &[UnitId]) -> Result<BTreeSet<UnitId>, Outcome>
§12d: netwatch’s footprints in /run/planarian/footprint, read with its
own fail-closed rules, at the boot clock’s now.
fn observe(&self, id: &UnitId) -> Result<Observed, Outcome>
Source§fn foreign_units(&self) -> Vec<String>
fn foreign_units(&self) -> Vec<String>
The boot report’s unit check (§10): active units whose definition does
not come from the running generation (a file outside the store that is
not a generator’s).
Source§fn ended_by(&self, id: &UnitId) -> Option<Ending>
fn ended_by(&self, id: &UnitId) -> Option<Ending>
How the unit’s main process last ended; None if the backend cannot say.
Source§fn auto_restarts(&self, id: &UnitId) -> Option<u32>
fn auto_restarts(&self, id: &UnitId) -> Option<u32>
How many times systemd itself restarted the unit (
NRestarts); None
if the backend cannot say.fn list(&self) -> Result<Vec<UnitId>, Outcome>
Source§fn start_agent(
&self,
name: &str,
argv: &[String],
limits: &AgentLimits,
) -> Result<InstanceId, Outcome>
fn start_agent( &self, name: &str, argv: &[String], limits: &AgentLimits, ) -> Result<InstanceId, Outcome>
Start an agent (§11, §16): the transient unit
planarian-agent-<name>,
under a dynamic uid of its own. Returns the started unit’s instance
(its InvocationID), read back once it has started (I24).Source§fn agent_running(&self, name: &str) -> bool
fn agent_running(&self, name: &str) -> bool
Whether an agent’s unit under this name is loaded and running (I24:
agent run refuses a name in use).fn restart(&self, id: &UnitId, op: &OpId) -> Outcome
fn stop(&self, id: &UnitId, op: &OpId) -> Outcome
Source§fn hold(&self, unit: &UnitId, wait: Millis) -> Outcome
fn hold(&self, unit: &UnitId, wait: Millis) -> Outcome
§12d Network security fails closed: hold the traffic a failed
network-security unit protected (
planarian-hold@<unit>). A failure
posture response, not a transition: no Prepared, no lease (it only
ever restricts traffic; docs/bypasses.md). Idempotent. Unlike the
other mutations here it takes no OpId; the daemon journals
HoldApplied before calling it. Read moreSource§fn lift_hold(&self, unit: &UnitId, wait: Millis) -> Outcome
fn lift_hold(&self, unit: &UnitId, wait: Millis) -> Outcome
Lift a unit’s hold, once it is Running and its Readiness probes pass
(journaled
HoldLifted first). Idempotent. At most wait.Source§fn held(&self) -> Result<BTreeSet<UnitId>, Outcome>
fn held(&self) -> Result<BTreeSet<UnitId>, Outcome>
The units whose traffic is held now, as the host says (§12d: the
hold survives a restart of planariad). An error means “cannot say”,
never “none”.
Source§fn release_hold(
&self,
unit: &UnitId,
until: Option<Timestamp>,
wait: Millis,
) -> Outcome
fn release_hold( &self, unit: &UnitId, until: Option<Timestamp>, wait: Millis, ) -> Outcome
planarian hold release (an attested Override, decided before this):
mark the unit’s hold released until until (None: the next boot),
then lift it, waiting at most wait. While the mark stands, a new
failure does not hold.Source§fn end_release(&self, unit: &UnitId) -> Outcome
fn end_release(&self, unit: &UnitId) -> Outcome
The release ended (expired, or the override lifted): remove the mark.
Source§fn hold_table_present(&self, wait: Millis) -> Result<bool, Outcome>
fn hold_table_present(&self, wait: Millis) -> Result<bool, Outcome>
Whether the hold’s nftables table is in place. Anything else that
flushes the ruleset (
nft flush ruleset) removes it and would fail
open; the daemon checks this while a hold is active. An error means
“cannot say” (also past wait).Auto Trait Implementations§
impl Freeze for Systemd
impl RefUnwindSafe for Systemd
impl Send for Systemd
impl Sync for Systemd
impl Unpin for Systemd
impl UnsafeUnpin for Systemd
impl UnwindSafe for Systemd
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more