Документация и runtime: полный production-fix по fix6 без legacy
This commit is contained in:
@@ -130,13 +130,18 @@ impl Config {
|
||||
fn check_host_tools(&self) -> anyhow::Result<()> {
|
||||
let mut required = vec!["tc", "ip", "wg", "docker", "modprobe"];
|
||||
if !crate::netns::nsenter_available() {
|
||||
eprintln!("nsenter is not available, will use docker exec fallback");
|
||||
} else {
|
||||
required.push("nsenter");
|
||||
anyhow::bail!("required host tool not found in PATH: nsenter");
|
||||
}
|
||||
required.push("nsenter");
|
||||
if self.anti_torrent.enabled {
|
||||
required.push("nft");
|
||||
}
|
||||
if self.reboot.enabled {
|
||||
required.push("systemctl");
|
||||
}
|
||||
if self.swap.enabled {
|
||||
required.extend(["fallocate", "chmod", "mkswap", "swapon", "sysctl"]);
|
||||
}
|
||||
|
||||
for tool in required {
|
||||
if !tool_exists(tool) {
|
||||
@@ -199,6 +204,12 @@ fn tool_exists(tool: &str) -> bool {
|
||||
"modprobe" => &[&["--version"]],
|
||||
"nsenter" => &[&["--help"]],
|
||||
"nft" => &[&["--version"]],
|
||||
"systemctl" => &[&["--version"], &["--help"]],
|
||||
"fallocate" => &[&["--help"]],
|
||||
"chmod" => &[&["--help"]],
|
||||
"mkswap" => &[&["--help"]],
|
||||
"swapon" => &[&["--help"]],
|
||||
"sysctl" => &[&["--version"], &["--help"]],
|
||||
_ => &[&["--version"], &["--help"], &["-V"]],
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user