pub struct SystemChecks { /* private fields */ }Implementations§
Source§impl SystemChecks
impl SystemChecks
pub fn new(host_executor: HostNamespaceExecutor) -> Self
pub async fn run_all(&self) -> CheckGroupResult
Sourcepub async fn has_nft_bin(&self) -> CheckResult
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.
Sourcepub async fn has_linux_util_bins(&self, bins: &[&str]) -> CheckResult
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.
Sourcepub async fn has_grub_mkconfig_bin(&self) -> CheckResult
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.
Sourcepub async fn has_service_manager_bin(&self) -> CheckResult
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.
Sourcepub async fn has_package_manager_bin(&self) -> CheckResult
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.
Sourcepub async fn enough_memory(&self) -> CheckResult
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/meminfoSourcepub async fn enough_disk(&self) -> CheckResult
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 }'