Skip to main content

booted

Function booted 

Source
pub fn booted() -> Result<bool>
Expand description

Checks whether the system has been booted by systemd.

This is implemented by verifying that a /run/systemd/system directory exists.

ยงExample

match sd_notify::booted() {
    Ok(true) => { println!("System is booted under systemd") },
    Ok(false) => { println!("System is not booted under systemd") },
    Err(e) => { println!("Error: {}", e) },
}