Skip to main content

SystemChecks

Struct SystemChecks 

Source
pub struct SystemChecks { /* private fields */ }

Implementations§

Source§

impl SystemChecks

Source

pub fn new(host_executor: HostNamespaceExecutor) -> Self

Source

pub async fn run_all(&self) -> CheckGroupResult

Source

pub async fn has_nft_bin(&self) -> CheckResult

Checks that the nft binary, typically from the nftables package, is in PATH. Currently, the installer and protect-network rely on this.

Source

pub async fn has_linux_util_bins(&self, bins: &[&str]) -> CheckResult

Checks that the given util-linux/coreutils/etc binaries are present in PATH. It is assumed that all of these respond to --version. On all supported systems this should be a given. Currently, the installer relies explicitly on these being present on the host.

Source

pub async fn has_grub_mkconfig_bin(&self) -> CheckResult

Checks that either grub-mkconfig or grub2-mkconfig is present in PATH, as the installer currently requires one or the other.

Source

pub async fn has_service_manager_bin(&self) -> CheckResult

Checks that either systemctl or rc-update is present in PATH, as the installer requires one or the other to enable services.

Source

pub async fn has_package_manager_bin(&self) -> CheckResult

Checks that at least one supported package manager is present in PATH, as the installer requires one to install system packages.

Source

pub async fn enough_memory(&self) -> CheckResult

Checks that total system RAM is at least 4 GB.

Manual equivalent:

awk '/MemTotal/ { if ($2 >= 4194304) print "OK"; else print "FAIL" }' /proc/meminfo
Source

pub async fn enough_disk(&self) -> CheckResult

Checks that at least one mounted filesystem has 20 GB or more of available space.

Manual equivalent:

df -BG | awk 'NR>1 { gsub(/G/,""); if (int($4) >= 20) found=1 } END { exit !found }'

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> 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, 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.