Skip to main content

Systemd

Struct Systemd 

Source
pub struct Systemd {
    txn_dir: PathBuf,
}

Fields§

§txn_dir: PathBuf

Implementations§

Source§

impl Systemd

Source

pub fn new(txn_dir: PathBuf) -> Systemd

Source

fn ctl(&self, scope: &Scope, args: &[&str], timeout: Duration) -> Output

Source

fn job(&self, verb: &str, id: &UnitId, op: &OpId) -> Outcome

Trait Implementations§

Source§

impl Clone for Systemd

Source§

fn clone(&self) -> Systemd

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Systemd

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl UnitBackend for Systemd

Source§

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.

Source§

fn observe(&self, id: &UnitId) -> Result<Observed, Outcome>

Source§

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>

How the unit’s main process last ended; None if the backend cannot say.
Source§

fn auto_restarts(&self, id: &UnitId) -> Option<u32>

How many times systemd itself restarted the unit (NRestarts); None if the backend cannot say.
Source§

fn list(&self) -> Result<Vec<UnitId>, Outcome>

Source§

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

Whether an agent’s unit under this name is loaded and running (I24: agent run refuses a name in use).
Source§

fn restart(&self, id: &UnitId, op: &OpId) -> Outcome

Source§

fn stop(&self, id: &UnitId, op: &OpId) -> Outcome

Source§

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 more
Source§

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>

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

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

The release ended (expired, or the override lifted): remove the mark.
Source§

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).
Source§

fn reapply_hold(&self, unit: &UnitId, wait: Millis) -> Outcome

Build a unit’s hold again (the table was removed under it): restart its hold unit, since starting an active one does nothing. At most wait.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.