Skip to main content

apply_unit_details

Function apply_unit_details 

Source
pub async fn apply_unit_details(
    endpoint: &VarlinkEndpoint,
    locked_machine_stats: &Arc<RwLock<MachineStats>>,
    config: &Config,
    fs_root: &str,
    discovery: &UnitDiscovery,
) -> Result<()>
Expand description

Collect per-unit detail over varlink: ServiceStats for the [services] list, the tracked timers, and the service types the oneshot health override needs.

Both come from io.systemd.Unit.List, through one connection and one cache, so a unit wanted by both is fetched once. This replaces the per-service and oneshot-type D-Bus fetches the varlink path used to fall back to.

Selection runs under a read lock and the varlink round trips hold no lock at all, so they never block other collectors on the shared MachineStats lock.