fn refresh_deadend_status(node: &Node) -> Result<()> {
    match evaluate_deadend(node) {
        Some(reason) => {
            BOOTED_DEADEND.set(1);
            if !DEADEND_STATE.is_deadend() {
                log::warn!("current release detected as dead-end, reason: {}", reason);
                std::process::Command::new("pkexec")
                    .arg("/usr/libexec/zincati")
                    .arg("deadend-motd")
                    .arg("set")
                    .arg("--reason")
                    .arg(reason)
                    .output()
                    .context("failed to write dead-end release information")?;
                DEADEND_STATE.set_deadend();
                log::debug!("MOTD updated with dead-end state");
            }
        }
        None => {
            BOOTED_DEADEND.set(0);
            if !DEADEND_STATE.is_no_deadend() {
                log::info!("current release detected as not a dead-end");
                std::process::Command::new("pkexec")
                    .arg("/usr/libexec/zincati")
                    .arg("deadend-motd")
                    .arg("unset")
                    .output()
                    .context("failed to remove dead-end release MOTD file")?;
                DEADEND_STATE.set_no_deadend();
                log::debug!("MOTD updated with no dead-end state");
            }
        }
    };
    Ok(())
}
/// Evaluate and record whether booted OS is a dead-end release, and
/// log that information in a MOTD file.
Evaluate and record whether booted OS is a dead-end release, and
log that information in a MOTD file.
Evaluate and record whether booted OS is a dead - end release and log that information in a MOTD file .
fn refresh_deadend_status(node: &Node) -> Result<()> {
    match evaluate_deadend(node) {
        Some(reason) => {
            BOOTED_DEADEND.set(1);
            if !DEADEND_STATE.is_deadend() {
                log::warn!("current release detected as dead-end, reason: {}", reason);
                std::process::Command::new("pkexec")
                    .arg("/usr/libexec/zincati")
                    .arg("deadend-motd")
                    .arg("set")
                    .arg("--reason")
                    .arg(reason)
                    .output()
                    .context("failed to write dead-end release information")?;
                DEADEND_STATE.set_deadend();
                log::debug!("MOTD updated with dead-end state");
            }
        }
        None => {
            BOOTED_DEADEND.set(0);
            if !DEADEND_STATE.is_no_deadend() {
                log::info!("current release detected as not a dead-end");
                std::process::Command::new("pkexec")
                    .arg("/usr/libexec/zincati")
                    .arg("deadend-motd")
                    .arg("unset")
                    .output()
                    .context("failed to remove dead-end release MOTD file")?;
                DEADEND_STATE.set_no_deadend();
                log::debug!("MOTD updated with no dead-end state");
            }
        }
    };
    Ok(())
}
fn refresh_deadend_status ( node : & Node ) -> Result < ( ) > { match evaluate_deadend ( node ) { Some ( reason ) => { BOOTED_DEADEND . set ( 1 ) ; if ! DEADEND_STATE . is_deadend ( ) { log :: warn ! ( " " reason ) ; std :: process :: Command :: new ( " " ) . arg ( " " ) . arg ( " " ) . arg ( " " ) . arg ( " " ) . arg ( reason ) . output ( ) . context ( " " ) ? ; DEADEND_STATE . set_deadend ( ) ; log :: debug ! ( " " ) ; } } None => { BOOTED_DEADEND . set ( 0 ) ; if ! DEADEND_STATE . is_no_deadend ( ) { log :: info ! ( " " ) ; std :: process :: Command :: new ( " " ) . arg ( " " ) . arg ( " " ) . arg ( " " ) . output ( ) . context ( " " ) ? ; DEADEND_STATE . set_no_deadend ( ) ; log :: debug ! ( " " ) ; } } } ; Ok ( ( ) ) }
Evaluate and record whether booted OS is a dead-end release, and
log that information in a MOTD file.
Evaluate and record whether booted OS is a dead - end release and log that information in a MOTD file .
node
&Node